MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 228

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Example
The pre-decrement form of the operator decrements
as
:
y
x = 3;
y = --x;
//y is equal to 2
The post-decrement form of the operator decrements
value of
as the result
x
x = 3;
y = x--
//y is equal to 3
++ (increment)
Availability
Flash Player 4.
Usage
++expression
expression++
Parameters
None.
Returns
A number.
Description
Operator (arithmetic); a pre-increment and post-increment unary operator that adds 1 to
. The
expression
The pre-increment form of the operator (
result. The post-increment form of the operator (
returns the initial value of
The pre-increment form of the operator increments
as
:
y
x = 1;
y = ++x
//y is equal to 2
The post-increment form of the operator increments
value of
as the result
x
x = 1;
y = x++;
//y is equal to 1
228
Chapter 12: ActionScript Dictionary
:
y
can be a variable, element in an array, or property of an object.
expression
(the value prior to the addition).
expression
:
y
to 2 (
x
x - 1 = 2
to 2 (
x
x - 1 = 2
) adds 1 to
++expression
expression++
to 2 (
x
x + 1 = 2
to 2 (
x
x + 1 = 2
), and returns the result
), and returns the original
and returns the
expression
) adds 1 to
expression
), and returns the result
), and returns the original
and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Table of Contents