ActionScript Operators Reference
The following is a list of the operators in ActionScript 3.0:
Basic Operators
The following table shows the operators used throughout the language in a variety of situations.
Mathematical Operators
The following table describes the operators used in mathematical expressions:
Operator | Description | Example |
---|---|---|
+ | Performs addition |
|
- | Performs subtraction | var total:Number = num1 – num2; |
* | Performs multiplication |
|
/ | Performs division |
|
% | Returns modulus, the remainder in a division problem |
|
++ | Increments the value by one |
|
-- | Decrements the value by one |
|
+= | Adds the value to the right to the current value of the variable |
|
-= | Subtracts the value to the right from the current value of the variable |
|
*= | Multiplies the value to the right by the current value |
|
/= | Divides the value to the right by the current value |
|
Comparison Operators
The following table summarizes the comparison operators that you can use in your scripts:
Operator | Description | Example |
---|---|---|
< | Less than | |
> | Greater than |
|
<= | Less than or equal to |
|
>= | Greater than or equal to |
|
!= | Not equal to |
|
== | Equal to |
|
Boolean Operators
The following table summarizes the Boolean operators available in ActionScript 3.0:
Operator | Description | Example |
---|---|---|
! | Logical NOT; negates value |
|
|| | Logical OR |
|
&& | Logical AND |
|
3.148.107.255