03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

This script displays the following result in the Output panel:<br />

0,1,2,3,4,5,6,7,8,9<br />

!= inequality operator<br />

expression1 != expression2<br />

Tests for the exact opposite of the equality ( ==) operator. If expression1 is equal to<br />

expression2 , the result is false. As with the equality (==) operator, the definition of equal<br />

depends on the data types being compared, as illustrated in the following list:<br />

■ Numbers, strings, <strong>and</strong> Boolean values are compared by value.<br />

■ Objects, arrays, <strong>and</strong> functions are compared by reference.<br />

■ A variable is compared by value or by reference, depending on its type.<br />

Comparison by value means what most people would expect equals to mean--that two<br />

expressions have the same value. For example, the expression (2 + 3) is equal to the expression<br />

(1 + 4) when compared by value.<br />

Comparison by reference means that two expressions are equal only if they both refer to the<br />

same object, array, or function. Values inside the object, array, or function are not compared.<br />

When comparing by value, if expression1 <strong>and</strong> expression2are different data types,<br />

<strong>ActionScript</strong> will attempt to convert the data type of expression2 to match that of<br />

expression1.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

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

expression1 : Object - A number, string, Boolean value, variable, object, array, or<br />

function.<br />

expression2 : Object - A number, string, Boolean value, variable, object, array, or<br />

function.<br />

Returns<br />

Boolean - The Boolean result of the comparison.<br />

Example<br />

The following example illustrates the result of the inequality (!=) operator:<br />

trace(5 != 8); // returns true<br />

trace(5 != 5) //returns false<br />

170 <strong>ActionScript</strong> language elements

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

Saved successfully!

Ooh no, something went wrong!