+ (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
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...