03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

This operator also performs string concatenation. All the rules of the addition (+) operator<br />

apply to the addition assignment (+=) operator.<br />

Oper<strong>and</strong>s<br />

expression1 : Number - A number or string.<br />

expression2 : Number - A number or string.<br />

Returns<br />

Number - The result of the addition.<br />

Example<br />

Usage 1: This example uses the+= operator with a string expression <strong>and</strong> sends "My name is<br />

Gilbert" to the Output panel.<br />

var x1:String = "My name is ";<br />

x1 += "Gilbert";<br />

trace(x1); // output: My name is Gilbert<br />

Usage 2: The following example shows a numeric use of the addition assignment (+=)<br />

operator:<br />

var x:Number = 5;<br />

var y:Number = 10;<br />

x += y;<br />

trace(x); // output: 15<br />

See also<br />

+ addition operator<br />

[] array access operator<br />

myArray = [ a0, a1,...aN ]<br />

myArray[ i ] = value<br />

myObject [ propertyName ]<br />

Initializes a new array or multidimensional array with the specified elements (a0, <strong>and</strong> so on),<br />

or accesses elements in an array. The array access operator lets you dynamically set <strong>and</strong> retrieve<br />

instance, variable, <strong>and</strong> object names. It also lets you access object properties.<br />

Usage 1: An array is an object whose properties are called elements, which are each identified<br />

by a number called an index. When you create an array, you surround the elements with the<br />

array access ([]) operator (or brackets). An array can contain elements of various types. For<br />

example, the following array, called employee, has three elements; the first is a number <strong>and</strong><br />

the second two are strings (inside quotation marks):<br />

112 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!