Operators and Control Structures

ActionScript basic operators and control structures are broken down into the following tables:

Table D-1
Table D-2
Table D-3
Table D-4
Table D-5
Table D-6
Table D-7
Table D-1. Arithmetic operations

Operator

Description

( )

Parentheses

*

Multiply

/

Divide

%

Modulo

+

Add

Subtract

−−

Decrement

++

Increment

Table D-2. Assignment operations

Operator

Description

=

Assignment

*=

Multiplication assignment

/=

Division assignment

%=

Modulo assignment

+=

Addition assignment

−=

Subtraction assignment

&=

Bitwise AND assignment

|=

Bitwise OR assignment

^=

Bitwise XOR assignment

Table D-3. Logical operations

Operator

Description

!

Logical NOT (you can also use the keyword not)

˜

Bitwise NOT

&

Bitwise AND

&&

Logical AND (you can also use the keyword and)

?:

Conditional

|

Bitwise OR

||

Logical OR (you can also use the keyword or)

^

Bitwise XOR

Table D-4. Comparison operations

Operator

Description

!=, <>

Inequality

= =

Equality

<

Less than

>

Greater than

<=

Less than or equal to

>=

Greater than or equal to

eq

String equal

ge

String greater than or equal to

gt

String greater than

le

String less than or equal to

lt

String less than

ne

String not equal

Table D-5. Bit operations

Operator

Description

<<

Bitwise left shift

<<=

Bitwise left shift and assignment

>>

Bitwise right shift

>>=

Bitwise right shift and assignment

>>>

Bitwise unsigned right shift

>>>=

Bitwise unsigned right shift and assignment

Table D-6. Other operators

Operator

Description

.

The dot operator, which allows you to call methods of an object or access its properties

[ ]

Array element access operator

//

Single-line ...

Get Perl Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.