MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 45

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

In Flash 5 or later, you cannot use
variable or instance name, because you cannot use
example, replace the code
eval ("var" + i) = "first";
with this:
this["var"+i] = "first"
or this:
set ("var" + i, "first");
Availability: ActionScript 1.0; Flash Lite 1.0 - Flash Player 5 or later for full functionality.
You can use the
eval()
notation and can access only variables, not properties or objects.
Parameters
expression:Object
parameter can be either a String or a direct reference to the object instance (i.e use of
quotation marks (" ") is optional.)
Returns
- A value, reference to an object or movie clip, or
Object
Example
The following example uses
ActionScript sets the
, and
square2_mc
square3_mc
for (var i = 1; i <= 3; i++) {
setProperty(eval("square"+i+"_mc"), _rotation, 5);
}
You can also use the following ActionScript:
for (var i = 1; i <= 3; i++) {
this["square"+i+"_mc"]._rotation = -5;
}
See also
,
Array
set variable statement
eval()
function when exporting to Flash Player 4, but you must use slash
- The name of a variable, property, object, or movie clip to retrieve. This
to set properties for dynamically named movie clips. This
eval()
property for three movie clips, called
_rotation
.
to dynamically set and retrieve the value of a
on the left side of an equation. For
eval()
undefined
.
,
square1_mc
Global Functions
45

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents