MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 186

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

About postfix operators
The postfix operators take one operator and either increment or decrement the operator's
value. Although these operators are unary operators, they are classified separately from the rest
of the unary operators because of their higher precedence and special behavior. For
information on unary operators, see
When you use a postfix operator as part of a larger expression, the expression's value is
returned before the postfix operator is processed. For example, the following code shows how
the value of the expression
var xNum:Number = 0;
trace(xNum++); // 0
trace(xNum); // 1
When you trace this code, the text in the Output panel reads:
0
1
The operators in this table have equal precedence:
Operator
Operation performed
Increment (postfix)
++
Decrement (postfix)
--
About unary operators
Unary operators take one operand. The increment (
group are prefix operators, which means that they appear before the operand in an expression.
They can also appear after the operand, in which case they are postfix operators. For
information on postfix operators, see
The prefix operators differ from the postfix counterparts because the increment or decrement
operation completes before the value of the overall expression is returned. For example, the
following code shows how the value of the expression
incremented.
var xNum:Number = 0;
trace(++xNum); // 1
trace(xNum); // 1
186
Syntax and Language Fundamentals
"About unary operators" on page
is returned before the value is incremented.
xNum++
"About postfix operators" on page
186.
) and decrement (
++
--
186.
is returned after the value is
xNum++
) operators in this

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents