You could also write this code using the
a movie clip, but an object, you could not use the
tellTarget ("someOther_mc") {
_x = 50;
_y = 100;
gotoAndStop(3);
}
The
action is useful for accessing multiple items in a scope chain list simultaneously. In the
with
following example, the built-in
as a default object resolves the identifiers
respectively. The identifiers
since they exist in the object activation scope of the function
corresponding local variables.
function polar(r) {
var a, x, y;
with (Math) {
a = PI * r * r;
x = r * cos(PI);
y = r * sin(PI/2);
}
trace("area = " +a);
trace("x = " + x);
trace("y = " + y);
}
You can use nested
example, the instance
The statement sets the
of
.
california
with (california){
with (fresno){
_alpha = 20;
}
with (salinas){
_alpha = 40;
}
}
See also
tellTarget
XML class
Availability
Flash Player 5 (became a native object in Flash Player 6, which improved
performance significantly).
Description
Use the methods and properties of the XML class to load, parse, send, build, and manipulate
XML document trees.
You must use the constructor
methods of the XML class.
tellTarget
object is placed at the front of the scope chain. Setting
Math
cos
,
,
, and
a
x
y
r
actions to access information in multiple scopes. In the following
with
and the instance
fresno
values of
_alpha
fresno
new XML()
action. However, if
action.
with
,
, and
to
sin
PI
Math.cos
are not methods or properties of the
polar()
are children of the instance
salinas
and
without changing the
salinas
to create an XML object before calling any of the
were not
someOther_mc
,
, and
Math.sin
Math.PI
object, but
Math
, they resolve to the
california
_alpha
XML class
Math
,
.
value
751
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?