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

Create successful ePaper yourself

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

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

expression1 : Object - Numbers, strings, or variables.<br />

expression2 : Object - Numbers, strings, or variables.<br />

Returns<br />

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

See also<br />

>= greater than or equal to operator<br />

++ increment operator<br />

++expression<br />

expression++<br />

A pre-increment <strong>and</strong> post-increment unary operator that adds 1 to expression . The<br />

expression can be a variable, element in an array, or property of an object. The preincrement<br />

form of the operator (++expression) adds 1 to expression <strong>and</strong> returns the<br />

result. The post-increment form of the operator (expression++) adds 1 to expression <strong>and</strong><br />

returns the initial value of expression (the value prior to the addition).<br />

The pre-increment form of the operator increments x to 2 (x + 1 = 2) <strong>and</strong><br />

returns the result as y:<br />

var x:Number = 1;<br />

var y:Number = ++x;<br />

trace("x:"+x); //traces x:2<br />

trace("y:"+y); //traces y:2<br />

The post-increment form of the operator increments x to 2 (x + 1 = 2) <strong>and</strong> returns the<br />

original value of x as the result y:<br />

var x:Number = 1;<br />

var y:Number = x++;<br />

trace("x:"+x); //traces x:2<br />

trace("y:"+y); //traces y:1<br />

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

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

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

Returns<br />

Number - The result of the increment.<br />

168 <strong>ActionScript</strong> language elements

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

Saved successfully!

Ooh no, something went wrong!