Flash Player 5.
my_mc.attachMovie(idName:String,newName:String,depth:Number[,initObject:Object]): MovieClip
idName The linkage name of the movie clip symbol in the library to attach to a movie clip on the Stage. This is the name entered in the Identifier field in the Linkage Properties dialog box.
newname A unique instance name for the movie clip being attached to the movie clip.
depth An integer specifying the depth level where the SWF file is placed.
initObject (Supported for Flash Player 6 and later) An object containing properties with which to populate the newly attached movie clip. This parameter allows dynamically created movie clips to receive clip parameters. If initObject is not an object, it is ignored. All properties of initObject are copied into the new instance. The properties specified with initObject are available to the constructor function. This parameter is optional.
A reference to the newly created instance.
Method; takes a symbol from the library and attaches it to the SWF file on the Stage specified by my_mc. Use MovieClip.removeMovieClip() or MovieClip.unloadMovie() to remove a SWF file attached with attachMovie().
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.
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});
MovieClip.removeMovieClip(), MovieClip.unloadMovie(), removeMovieClip()
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001487.html
Comments
recoveredfromflashMX2004 said on Aug 4, 2004 at 3:16 PM : TheJhereg said on Aug 31, 2004 at 2:37 PM : nanodust said on Sep 17, 2004 at 5:58 PM : Niels Peter said on Sep 20, 2004 at 4:35 AM : No screen name said on Oct 6, 2004 at 1:42 AM : jsoukup said on Oct 7, 2004 at 12:45 PM : chambio said on Nov 4, 2004 at 10:35 AM : anm8tr said on Nov 9, 2004 at 9:16 AM : phantompainter said on Nov 9, 2004 at 2:04 PM :