Flash Player 4.
duplicateMovieClip(target:String,newname:String,depth:Number): Void
target The target path of the movie clip to duplicate.
newname A unique identifier for the duplicated movie clip.
depth A unique depth level for the duplicated movie clip. The depth level is a stacking order for duplicated movie clips. This stacking order is similar to the stacking order of layers in the Timeline; movie clips with a lower depth level are hidden under clips with a higher stacking order. You must assign each duplicated movie clip a unique depth level to prevent it from replacing SWF files on occupied depths.
Nothing
Function; creates an instance of a movie clip while the SWF file is playing. The playhead in duplicate movie clips always starts at Frame 1, regardless of where the playhead is in the original movie clip. Variables in the original movie clip are not copied into the duplicate movie clip. Use the removeMovieClip() function or method to delete a movie clip instance created with duplicateMovieClip().
In the following example, a new movie clip instance is created called img_mc. An image is loaded into the movie clip, and then the img_mc clip is duplicated. The duplicated clip is called newImg_mc, and this new clip is moved on the Stage so it does not overlap the original clip, and the same image is loaded into the second clip.
this.createEmptyMovieClip("img_mc", this.getNextHighestDepth());
img_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/112x112/box_studio_112x112.jpg");
duplicateMovieClip(img_mc, "newImg_mc", this.getNextHighestDepth());
newImg_mc._x = 200;
newImg_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/112x112/box_studio_112x112.jpg");
To remove the duplicate movie clip, you could add this code for a button called myButton_btn.
this.myButton_btn.onRelease = function(){
removeMovieClip(newImg_mc);
};
MovieClip.duplicateMovieClip(), removeMovieClip(), MovieClip.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/00001336.html
Comments
spiffier said on Sep 16, 2004 at 7:07 AM : decswxaqz said on Sep 22, 2004 at 7:28 AM : No screen name said on Oct 12, 2004 at 1:43 PM : No screen name said on Oct 21, 2004 at 3:28 PM : Gratman said on Nov 23, 2004 at 9:47 AM : No screen name said on Dec 1, 2004 at 6:54 AM : No screen name said on Jan 18, 2005 at 5:14 AM : Neeil said on Jan 19, 2005 at 4:14 AM :