Name
MovieClip.attachMovie( ) Method — create a new movie clip instance from an exported Library symbol
Availability
Flash 5
Synopsis
mc.attachMovie(symbolIdentifier, newName, depth)
Arguments
- symbolIdentifier
A string specifying the linkage identifier of an exported movie clip symbol, as set in the Library under Options → Linkage.
- newName
A string specifying the new instance name of the clip being created. The name must adhere to the rules for creating an identifier outlined under Section 14.5 in Chapter 14.
- depth
An integer specifying the level on which to place the new clip in the programmatic clip stack above
mc
. A depth of -1 is below 0, 1 is in front of 0, 2 is in front of 1, and so on. See Section 13.4.2.1 in Chapter 13 for more details. Negative depths are functional but not officially supported by ActionScript; to ensure future compatibility, use depths of or greater.
Description
The attachMovie( )
method creates a new instance
called newName
based on the exported movie
clip symbol specified by symbolIdentifier
.
If mc
is the main movie, the new instance
is placed in the top-left corner of the Stage. If
mc
is a movie clip instance, the new
instance is placed on mc
’s
registration point. In either case, the new instance is placed above
mc
in a stack of
programmatically-generated clips.
See Also
duplicateMovieClip( )
,
MovieClip.duplicateMovieClip( )
; Section 13.3.2.3 and Section 13.4.2.1
in Chapter 13
Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.