572
Chapter 7: ActionScript for Flash
Parameters
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.
Returns
A reference to the duplicated movie clip.
Description
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.
Example
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});
See also
duplicateMovieClip()
,
MovieClip.removeMovieClip()
MovieClip.enabled
Availability
Flash Player 6.
Usage
my_mc
.enabled
:Boolean
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...