This step ensures that any references to
—refers to its own timeline, not to the actual root timeline of container.swf. Now
target_mc
when you click the button, "
Alternatively, the author of contents.swf could add the following code to its main timeline:
// Added to Frame 1 in contents.swf:
this._lockroot = true;
This would ensure that no matter where contents.swf is loaded, any reference it makes to
refers to its own main timeline, not to that of the hosting SWF file.
_root
For more information, see _lockroot (MovieClip._lockroot property).
Loading image files into movie clips
You can use the
loadMovie()
image files into a movie clip instance. You can also use the
an image 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 might 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
(
MovieClip.loadMovie method)
2.0 Language Reference and
Changing movie clip position and
appearance
To change the properties of a movie clip as it plays, write a statement that assigns a value to a
property or use the
setProperty()
rotation of instance
mc
my_mc._rotation = 45;
This is equivalent to the following code, which uses the
setProperty("my_mc", _rotation, 45);
_root
" appears.
Tim
function, or the MovieClip method of the same name, to load
loadMovie function
, and
loadMovieNum function
"Loading external SWF and image files" on page
function. For example, the following code sets the
to 45:
in contents.swf—or any SWF file loaded into
loadMovieNum()
, loadMovie
in the ActionScript
setProperty()
Changing movie clip position and appearance
function to load
593.
function:
357
Need help?
Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?