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.

The following example uses assignment by reference to create a new object, <strong>and</strong> assign a<br />

reference to that object to the variable mercury. Assignment by value is then used to assign the<br />

value of 3030 to the diameter property of the mercury object:<br />

var mercury:Object = new Object(); mercury.diameter = 3030; // in miles<br />

trace (mercury.diameter); // output: 3030<br />

The following example builds upon the previous example by creating a variable named<br />

merkur (the German word for mercury) <strong>and</strong> assigning it the value of mercury. This creates<br />

two variables that reference the same object in memory, which means you can use either<br />

variable to access the object's properties. We can then change the diameter property to use<br />

kilometers instead of miles:<br />

var merkur:Object = mercury; merkur.diameter = 4878; // in kilometers trace<br />

(mercury.diameter); // output: 4878<br />

See also<br />

== equality operator<br />

& bitwise AND operator<br />

expression1 & expression2<br />

Converts expression1 <strong>and</strong> expression2 to 32-bit unsigned integers, <strong>and</strong> performs a<br />

Boolean AND operation on each bit of the integer parameters. Floating-point numbers are<br />

converted to integers by discarding any digits after the decimal point. The result is a new 32bit<br />

integer.<br />

Positive integers are converted to an unsigned hex value with a maximum value of<br />

4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant<br />

digits discarded when they are converted so the value is still 32-bit. Negative numbers are<br />

converted to an unsigned hex value using the two's complement notation, with the minimum<br />

being -2147483648 or 0x800000000; numbers less than the minimum are converted to two's<br />

complement with greater precision <strong>and</strong> then have the most significant dig its discarded as<br />

well.<br />

The return value is interpreted as a signed two's complement number, so the return is an<br />

integer in the range -2147483648 to 2147483647.<br />

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

expression1 : Number - A number.<br />

expression2 : Number - A number.<br />

116 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!