About Operators - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

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
on page
114.
For example, a mathematical expression uses numerical operators to manipulate the values
you use. Examples of operator characters are
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
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.
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.
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 + 3;
In this example,
myNum
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
176
Syntax and Language Fundamentals
"About syntax, statements, and expressions"
+
,
and 2 are operands and
x + 2
x
.
myNum
and
are operands.
3
,
,
, and
. An expression consists of operators
<
*
=
is an operator.
+

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents