User Guide
+ (addition) 113
/* To clear the read-only flag in the flags variable, first construct a mask by
using bitwise NOT on ReadOnlyFlag. In the mask, every bit is a 1 except for
the read-only flag. Then, use bitwise AND with the mask to clear the read-
only flag. The following code constructs the mask and performs the bitwise
AND: */
flags &= ~ReadOnlyFlag;
trace(flags);
/* output:
0
1
0
*/
See also
& (bitwise AND)
, &= (bitwise AND assignment), ^ (bitwise XOR), ^= (bitwise XOR
assignment)
, | (bitwise OR), |= (bitwise OR assignment)
+ (addition)
Availability
Flash Player 5.
Usage
expression1 + expression2
Parameters
expression1,expression2
A number or string.
Returns
A string, integer, or floating-point number.
Description
Operator; adds numeric expressions or concatenates (combines) strings. If one expression is a
string, all other expressions are converted to strings and concatenated.
If both expressions are integers, the sum is an integer; if either or both expressions are floating-
point numbers, the sum is a floating-point number.
For more information, see “Operator precedence and associativity” on page 32.
Example
Usage 1: The following example concatenates two strings and writes the result to the log file.
var name:String = "Cola";
var instrument:String = "Drums";
trace(name+" plays "+instrument); // output: Cola plays Drums
Usage 2: This statement adds the integers 2 and 3 and writes the resulting integer, 5, to the log
file:
trace(2+3); // output: 5