180
ActionScript language elements
Returns
Number
- The value of
expression1
*
expression2
. If an expression cannot be converted
to a numeric value, it returns
NaN
(not a number).
Example
Usage 1: The following example assigns the value 50 to the variable
x
:
var x:Number = 5;
var y:Number = 10;
trace(x *= y); // output: 50
Usage 2: The second and third lines of the following example calculate the expressions on the
right side of the equal sign and assign the results to
x
and
y
:
var i:Number = 5;
var x:Number = 4 - 6;
var y:Number = i + 2;
trace(x *= y); // output: -14
See also
* multiplication operator
new operator
new
constructor()
Creates a new, initially anonymous, object and calls the function identified by the
constructor
parameter. The
new
operator passes to the function any optional parameters in
parentheses, as well as the newly created object, which is referenced using the keyword
this
.
The
constructor
function can then use
this
to set the variables of the object.
Availability:
ActionScript 1.0; Flash Player 5
Operands
constructor : Object
- A function followed by any optional parameters in parentheses.
The function is usually the name of the object type (for example,
Array
,
Number
, or
Object
)
to be constructed.
Example
The following example creates the
Book()
function and then uses the
new
operator to create
the objects
book1
and
book2
.
function Book(name, price){
this.name = name;
this.price = price;
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...