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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

POSITIVE_INFINITY (Number.POSITIVE_INFINITY<br />

property)<br />

public static POSITIVE_INFINITY : Number<br />

Specifies the IEEE-754 value representing positive infinity. The value of this property is the<br />

same as that of the constant Infinity.<br />

Positive infinity is a special numeric value that is returned when a mathematical operation or<br />

function returns a value larger than can be represented.<br />

Example<br />

This example compares the result of dividing the following values.<br />

var posResult:Number = 1/0;<br />

if (posResult == Number.POSITIVE_INFINITY) {<br />

trace("posResult = "+posResult); // output: posResult = Infinity<br />

}<br />

var negResult:Number = -1/0;<br />

if (negResult == Number.NEGATIVE_INFINITY) {<br />

trace("negResult = "+negResult); // output: negResult = -Infinity<br />

toString (Number.toString method)<br />

public toString(radix:Number) : String<br />

Returns the string representation of the specified Number object (myNumber).<br />

Parameters<br />

radix:Number - Specifies the numeric base (from 2 to 36) to use for the number-to-string<br />

conversion. If you do not specify the radix parameter, the default value is 10.<br />

Returns<br />

String - A string.<br />

Example<br />

The following example uses 2 <strong>and</strong> 8 for the radix parameter <strong>and</strong> returns a string that<br />

contains the corresponding representation of the number 9:<br />

var myNumber:Number = new Number(9);<br />

trace(myNumber.toString(2)); // output: 1001<br />

trace(myNumber.toString(8)); // output: 11<br />

The following example results in a hexadecimal value.<br />

var r:Number = new Number(250);<br />

var g:Number = new Number(128);<br />

518 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!