MACROMEDIA FLASH MX 2004-USING ACTIONSCRIPT IN FLASH Use Manual page 56

Using actionscript in flash
Hide thumbs Also See for FLASH MX 2004-USING ACTIONSCRIPT IN FLASH:
Table of Contents

Advertisement

Operator
Operation performed
-=
Subtraction and assignment
Multiplication and assignment
*=
Modulo and assignment
%=
/=
Division and assignment
<<=
Bitwise shift left and assignment
Bitwise shift right and assignment
>>=
Shift right zero fill and assignment
>>>=
^=
Bitwise XOR and assignment
Bitwise OR and assignment
|=
Bitwise AND and assignment
&=
Dot and array access operators
You can use the dot operator (
ActionScript object properties, including those of a movie clip.
Dot operator.
The dot operator uses the name of an object on its left side and the name of a
property or variable on its right side. The property or variable name can't be a string or a variable
that evaluates to a string; it must be an identifier. The following examples use the dot operator:
year.month = "June";
year.month.day = 9;
The dot operator and the array access operator perform the same role, but the dot operator takes
an identifier as its property, whereas the array access operator evaluates its contents to a name and
then accesses the value of that named property.
For example, the following expressions access the same variable
:
rocket
rocket.velocity;
rocket["velocity"];
Array access operator.
instance names and variables. For example, in the following code, the expression inside the array
access operator is evaluated, and the result of the evaluation is used as the name of the variable to
be retrieved from movie clip
name["mc" + i]
In ActionScript 2.0, you can use the bracket operator to access dynamically created properties, if
the dynamic keyword was not used to define the class, as shown in the following example:
class Foo {
}
// in a fla that uses Foo
var bar:Foo = new Foo();
56
Chapter 2: ActionScript Basics
) and the array access operator (
.
You can use the array access operator to dynamically set and retrieve
:
name
) to access built-in or custom
[]
in the movie clip
velocity

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents