03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

*= multiplication assignment operator<br />

expression1 *= expression2<br />

Assigns expression1 the value of expression1 * expression2. For example, the<br />

following two expressions are equivalent:<br />

x *= y x = x * y<br />

Oper<strong>and</strong>s<br />

expression1 : Number - A number or expression that evaluates to a number.<br />

expression2 : Number - A number or expression that evaluates to a number.<br />

Returns<br />

Number - The value of expression1 * expression2 . If an expression cannot be converted<br />

to a numeric value, it returns NaN (not a number).<br />

Example<br />

Usage 1: The following example assigns the value 50 to the variable x:<br />

var x:Number = 5;<br />

var y:Number = 10;<br />

trace(x *= y); // output: 50<br />

Usage 2: The second <strong>and</strong> third lines of the following example calculate the expressions on the<br />

right side of the equal sign <strong>and</strong> assign the results to x <strong>and</strong> y:<br />

var i:Number = 5;<br />

var x:Number = 4 - 6;<br />

var y:Number = i + 2;<br />

trace(x *= y); // output: -14<br />

See also<br />

* multiplication operator<br />

new operator<br />

new constructor()<br />

Creates a new, initially anonymous, object <strong>and</strong> calls the function identified by the<br />

constructor parameter. The new operator passes to the function any optional parameters in<br />

parentheses, as well as the newly created object, which is referenced using the keyword this.<br />

The constructor function can then use this to set the variables of the object.<br />

154 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!