EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Increment Operator

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
164 ActionScript language elements
Returns
Boolean - The result of the comparison.
See also
>= greater than or equal to operator
++ increment operator
++expression
expression++
A pre-increment and post-increment unary operator that adds 1 to expression . The
expression
can be a variable, element in an array, or property of an object. The pre-
increment form of the operator (
++expression) adds 1 to expression and returns the
result. The post-increment form of the operator (
expression++) adds 1 to expression and
returns the initial value of
expression (the value prior to the addition).
The pre-increment form of the operator increments x to 2 (x + 1 = 2) and
returns the result as y:
var x:Number = 1;
var y:Number = ++x;
trace("x:"+x); //traces x:2
trace("y:"+y); //traces y:2
The post-increment form of the operator increments x to 2 (x + 1 = 2) and returns the
original value of
x as the result y:
var x:Number = 1;
var y:Number = x++;
trace("x:"+x); //traces x:2
trace("y:"+y); //traces y:1
Availability: ActionScript 1.0; Flash Player 4
Operands
expression : Number - A number or a variable that evaluates to a number.
Returns
Number - The result of the increment.

Table of Contents

Related product manuals