Movieclip.attachmovie() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

MovieClip.attachMovie()

Availability
Flash Player 5.
Usage
my_mc.attachMovie(idName:String, newName:String, depth:Number [,
initObject:Object]) : MovieClip
Parameters
The linkage name of the movie clip symbol in the library to attach to a movie clip
idName
on the Stage. This is the name entered in the Identifier field in the Linkage Properties dialog box.
A unique instance name for the movie clip being attached to the movie clip.
newname
An integer specifying the depth level where the SWF file is placed.
depth
(Supported for Flash Player 6 and later) An object containing properties with
initObject
which to populate the newly attached movie clip. This parameter allows dynamically created
movie clips to receive clip parameters. If
of
are copied into the new instance. The properties specified with
initObject
available to the constructor function. This parameter is optional.
Returns
A reference to the newly created instance.
Description
Method; takes a symbol from the library and attaches it to the SWF file on the Stage specified by
. Use
my_mc
MovieClip.removeMovieClip()
file attached with
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For
more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
Example
The following example attaches the symbol with the linkage identifier "circle" to the movie clip
instance, which is on the Stage in the SWF file:
this.attachMovie("circle", "circle1_mc", this.getNextHighestDepth());
this.attachMovie("circle", "circle2_mc", this.getNextHighestDepth(), {_x:100,
_y:100});
See also
MovieClip.removeMovieClip(), MovieClip.unloadMovie(),
.
attachMovie()
is not an object, it is ignored. All properties
initObject
or
MovieClip.unloadMovie()
initObject
to remove a SWF
removeMovieClip()
MovieClip.attachMovie()
are
497

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents