176 Syntax and Language Fundamentals
About operators
This section describes general rules about common types of operators, operator precedence,
and operator associativity.
Operators are characters that specify how to combine, compare, or change values in an
expression. An expression is any statement that Flash can evaluate and that returns a value.
You can create an expression by combining operators and values or by calling a function. For
more information on expressions, see “About syntax, statements, and expressions”
on page 114.
For example, a mathematical expression uses numerical operators to manipulate the values
you use. Examples of operator characters are
+, <, *, and =. An expression consists of operators
and operands, and they are any legal combination of ActionScript symbols that represent a
value. An operand is the part of your code that the operator performs actions on. For
example, in the expression
x + 2, x and 2 are operands and + is an operator.
You use expressions and operators frequently throughout your code. You can combine
operators and values to create an expression, or you can call a function.
The parts of your code that the operator performs actions on are called operands. For example,
you can use the addition (+) operator to add values of a numeric literal. You could do this to
add the value of a variable called
myNum.
myNum + 3;
In this example, myNum and 3 are operands.
This section describes general rules about common types of operators, operator precedence,
and operator associativity:
■ “Using operators to manipulate values” on page 177
■ “About operator precedence and associativity” on page 179
■ “About using operators with strings” on page 182
■ “Using dot and array access operators” on page 184
■ “About postfix operators” on page 186
■ “About unary operators” on page 186
NOTE
This section describes how to use each type of operator; however, there isn't space to
cover each one. For information on every operator, including special operators that don’t
fall into the following categories, see the ActionScript 2.0 Language Reference.