THE FLASH 4 BIBLE (IDG BOOKS)  back to
FLASH 4 ACTIONSCRIPT OPERATORS  

flash 4 actionscript operators

numeric operators

+

Add

-

Subtract

*

Multiply

/

Divide

=

Equals. Used both for assignment and for comparison. Action Script does not use separate operators for those different operations (there is no==).

<>

Does not equal. (Often represented as !=in other languages.)

<

Less than.

>

Greater than.

<=

Less than or equal to.

>=

Greater than or equal to.

()

Group operations together, as in x=(x + y) * 3

 

string operators

“”

Indicate that the enclosed value should be interpreted as a string, not an expression.

eq

Is equal to, or the same as. e.g. if (name eq “derek”)

ne

Is not equal to. e.g. if (name ne “null”)

lt

Alphabetically before. So (“a” lt “b”) is true. If the strings compared have multiple characters, the first character determines the alphabetical position. So “apple” comes before “beet”. The lt, gt, le, and ge operators are based on ASCII values.

gt

Alphabetically after.

le

Alphabetically before or the same as.

ge

Alphabetically after or the same as.

&

Join two strings together, or add a string to a variable.

e.g. “he” & llo returns hello

 

logical operators

and

Require that two or more conditions be met in a single comparison. Often represented in other languages as &&.

Eg. While (counter < 10 AND quit eq false)

or

Require that one of two or more conditions be met in a single comparison. Often represented in other languages as ||.

not

Require the opposite of a condition to be met.

Eg. if (not (status eq “member”)

note
For quick reference within the application, the Flash operators are listed at the bottom left of the Expression editor.

 

about this info
this documentation is a short excerpt from colin moock's section of the 600 page book "the flash 4 bible", (idg books). to order, or for general information about the book, visit colin's flash 4 bible page.

revision history
november 30, 1999: created.
december 1, 1999: posted.