The scope chain used by the
the following list and continues to the last item:
The object specified in the
■
The object specified in the
■
The Activation object. (A temporary object that is automatically created when a function
■
is called that holds the local variables called in the function.)
The movie clip that contains the currently executing script.
■
The Global object (built-in objects such as Math and String).
■
To set a variable inside a
statement, or you must enter the full path to the Timeline on which you want the variable to
live. If you set a variable in a
look for the value according to the scope chain. If the variable doesn't already exist, the new
value will be set on the Timeline from which the
Instead of using
with()
cumbersome to type, you can create a local variable and store the path in the variable, which
you can then reuse in your code, as shown in the following ActionScript:
var shortcut = this._parent._parent.name_txt; shortcut.text = "Hank";
shortcut.autoSize = true;
Availability: ActionScript 1.0; Flash Lite 2.0
Parameters
- An instance of an ActionScript object or movie clip.
object:Object
Example
The following example sets the
instructs
someOther_mc
with (someOther_mc) {
_x = 50;
_y = 100;
gotoAndStop(3);
}
The following code snippet shows how to write the preceding code without using a
statement.
someOther_mc._x = 50;
someOther_mc._y = 100;
someOther_mc.gotoAndStop(3);
224
ActionScript language elements
statement to resolve identifiers starts with the first item in
with
parameter in the innermost
object
parameter in the outermost
object
statement, you must have declared the variable outside the
with
statement without declaring it, the
with
, you can use direct paths. If you find that paths are long and
and
properties of the
_x
_y
to go to Frame 3 and stop.
with
with
with
statement was called.
with
someOther_mc
statement.
statement.
with
statement will
instance, and then
with
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