MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 253

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Usage 3: This statement adds the integers 2 and 3 and displays the resulting integer, 5, in the
Output panel:
trace (2 + 3);
This statement adds the floating-point numbers 2.5 and 3.25 and displays the result,
floating-point number, in the Output panel:
trace (2.5 + 3.25);
See also
_accProps
+= (addition assignment)
Availability
Flash Player 4.
Usage
expression1 += expression2
Parameters
expression1,expression2
Returns
Nothing.
Description
Operator (arithmetic compound assignment); assigns
. For example, the following two statements have the same result:
expression2
x += y;
x = x + y;
This operator also performs string concatenation. All the rules of the addition operator
to the addition assignment
Example
The following example shows a numeric use of the
x = 5;
y = 10;
x += y;
trace(x);
//x returns 15
This example uses the
Output panel.
x = "My name is "
x += "Gilbert"
trace (x)
// returns "My name is Gilbert"
See also
+ (addition)
A number or string.
operator.
(+=)
operator with a string expression and sends "My name is Gilbert" to the
+=
the value of
expression1
operator.
+=
+= (addition assignment)
, a
5.75
expression1 +
apply
(+)
253

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents