To attach a movie clip to another movie clip:
Assign a linkage identifier to a movie clip library symbol, as described above.
1
With the Actions panel open (Window > Development Panels > Actions), select a frame in
2
the Timeline.
In the Actions panel's Script pane, type the name of the movie clip or level to which you want
3
to attach the new movie clip. For example, to attach the movie clip to the root Timeline,
type
.
_root
In the Actions toolbox (at the left of the Actions panel), click the Built-in Classes category, the
4
Movie category, and the MovieClip category, and double-click
Using the code hints that appear as a guide, enter values for the following parameters:
5
For
idName
For
newName
target it.
For
, enter the level at which the duplicate movie clip will be attached to the movie
depth
clip. Each attached movie clip has its own stacking order, with level 0 as the level of the
originating movie clip. Attached movie clips are always on top of the original movie clip.
Here is an example:
myMovieClip.attachMovie("calif", "california", 10);
For more information, see
Adding parameters to dynamically created movie clips
When you create or duplicate a movie clip dynamically using
MovieClip.duplicateMovie()
object. The
initObject
dynamically created movie clips to receive clip parameters. The
is optional.
For more information, see
MovieClip.duplicateMovieClip()
To populate a dynamically created movie clip with parameters from a specified object, do
one of the following:
•
Use the following syntax with
myMovieClip.attachMovie(idName, newName, depth [, initObject])
•
Use the following syntax with
myMovieClip.duplicateMovie(idName, newName, depth [, initObject])
The
initObject
populate the dynamically created movie clip.
128
Chapter 7: Working with Movie Clips
, specify the identifier you entered in the Linkage Properties dialog box.
, enter an instance name for the attached clip so that you will be able to
MovieClip.attachMovie()
, you can populate the movie clip with parameters from another
parameter of
attachMovie()
MovieClip.attachMovie()
on page
attachMovie()
duplicateMovie()
parameter specifies the name of the object whose parameters you want to use to
attachMovie()
on page
488.
MovieClip.attachMovie()
and
duplicateMovie()
initObject
on page 488
498.
:
:
.
allows
parameter
and
and
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers