% (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.
Summary of Contents for FLASH 8-FLASH
Page 1: ...Flash Lite 1 x ActionScript Language Reference...
Page 6: ...6 Contents...
Page 46: ...46 Flash Lite Global Functions...
Page 62: ...62 Flash Lite Properties...
Page 76: ...76 Flash Lite Statements...
Page 110: ...110 Flash Lite Operators...
Page 162: ...162 Index...