When contents.swf loads into the movie clip in container.swf, the value of
attached to the root Timeline of the hosting SWF file (container.swf ) would be set to
This could cause code in container.swf (as well as contents.swf ) to malfunction.
To force
to always evaluate to the Timeline of the loaded SWF file, rather than the actual
_root
root Timeline, use the
file or the SWF file being loaded. When
movie clip will act as
within a SWF file, that SWF file will act as its own root, no matter what other SWF file loads it.
Any movie clip, and any number of movie clips, can set
property is
false
For example, the author of container.swf could attach the following code to the
clip:
// Attached to target_mc movie clip:
onClipEvent (load) {
this._lockroot = true;
}
This would ensure that references to
—will refer to its own Timeline, not the actual root Timeline of container.swf.
target_mc
Equivalently, the author of contents.swf could add the following code to its main Timeline.
// Within contents.swf:
this._lockroot = true;
This would ensure that no matter where contents.swf is loaded, any reference it makes to
will refer to its own main Timeline, not that of the hosting SWF file.
For more information, see
Loading JPEG files into movie clips
You can use the
JPEG image files into a movie clip instance. You can also use the
load a JPEG file into a level.
When you load an image into a movie clip, the upper left corner of the image is placed at the
registration point of the movie clip. Because this registration point is often the center of the movie
clip, the loaded image may not appear centered. Also, when you load an image to a root Timeline,
the upper left corner of the image is placed on the upper left corner of the Stage. The loaded
image inherits rotation and scaling from the movie clip, but the original content of the movie clip
is removed.
For more information, see
on page
420,
MovieClip.loadMovie()
124
Chapter 7: Working with Movie Clips
property. This property can be set either by the loading SWF
_lockroot
for any SWF file loaded into it. When
_root
.
_root
MovieClip._lockroot
function, or the MovieClip method of the same name, to load
loadMovie()
"Loading external SWF and JPEG files" on page
is set to
_lockroot
true
_lockroot
in contents.swf—or any SWF file loaded into
on page
515.
on page
512, and
loadMovieNum()
that's
userName
"Mary"
on a movie clip instance, that
is set to
_lockroot
to
. By default, this
true
target_mc
function to
loadMovieNum()
194,
loadMovie()
on page
421.
.
true
movie
_root
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?