Flash Player 5.
my_mc.duplicateMovieClip(newname:String,depth:Number[,initObject:Object]): MovieClip
newname A unique identifier for the duplicate movie clip.
depth A unique number specifying the depth at which the SWF file specified is to be placed.
initObject (Supported for Flash Player 6 and later.) An object containing properties with which to populate the duplicated 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 duplicated movie clip.
Method; creates an instance of the specified movie clip while the SWF file is playing. Duplicated movie clips always start playing at Frame 1, no matter what frame the original movie clip is on when the duplicateMovieClip() method is called. Variables in the parent movie clip are not copied into the duplicate movie clip. Movie clips that have been created using duplicateMovieClip() are not duplicated if you call duplicateMovieClip() on their parent. If the parent movie clip is deleted, the duplicate movie clip is also deleted. If you have loaded a movie clip using MovieClip.loadMovie() or the MovieClipLoader class, the contents of the SWF file are not duplicated. This means that you cannot save bandwidth by loading a JPEG or SWF file and then duplicating the movie clip.
The following example duplicates the circle_mc movie clip. The code creates the movie clip, called circle1_mc, at the x, y coordinates 20,20.
circle_mc.duplicateMovieClip("circle1_mc", this.getNextHighestDepth(), {_x:20, _y:20});
duplicateMovieClip(), 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/00001496.html
Comments
Fumio Nonaka said on Dec 5, 2004 at 2:06 AM : No screen name said on Dec 9, 2004 at 8:26 AM : Neeil said on Jan 19, 2005 at 9:12 AM : nintybloke said on May 18, 2005 at 4:39 AM : Fumio Nonaka said on Jun 12, 2005 at 12:03 AM : sstringer said on Jul 6, 2005 at 5:18 PM : WebDuG said on Jul 15, 2005 at 12:57 PM : flashteacher.ca said on Jul 18, 2005 at 2:09 PM : petevenkman said on Aug 15, 2005 at 5:03 PM : Pimpelsang said on Oct 5, 2005 at 7:43 AM : ChrisDola said on Nov 8, 2005 at 7:39 AM :