EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 1.X ACTIONSCRIPT LANGUAGE - (Modulo)

MACROMEDIA FLASH 8-FLASH LITE 1.X ACTIONSCRIPT LANGUAGE
162 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
% (modulo) 93
Description
Operator (logical); evaluates expression1 and expression2. The result is true if either or
both expressions evaluate to
true; the result is false only if both expressions evaluate to
false. You can use the logical OR operator with any number of operands; if any operand
evaluates to
true, the result is true.
With non-Boolean expressions, the logical OR operator causes Flash Lite to evaluate the
expression on the left; if it can be converted to
true, the result is true. Otherwise, it evaluates
the expression on the right, and the result is the value of that expression.
Example
Usage 1: The following example uses the || operator in an if statement. The second
expression evaluates to
true, so the final result is true:
theMinimum = 10;
theMaximum = 250;
start = false;
if (theMinimum > 25 || theMaximum > 200 || start){
trace("the logical OR test passed");
}
% (modulo)
Availability
Flash Lite 1.0.
Usage
expression1 % expression2
Operands
expression1, expression2 Numbers or expressions that evaluate to numbers.
Description
Operator (arithmetic); calculates the remainder of expression1 divided by expression2. If
an
expression operand is non-numeric, the modulo operator attempts to convert it to a
number. The expression can be a number or string that converts to a numeric value.
When targeting Flash Lite 1.0 or 1.1, the Flash compiler expands the
% operator in the
published SWF file by using the following formula:
expression1 - int(expression1/expression2) * expression2
The performance of this approximation might not be as fast or as accurate as versions of Flash
Player that natively support the modulo operator.

Table of Contents

Related product manuals