Global Functions
43
Parameters
target
:
Object
- The target path of the movie clip to duplicate. This parameter can be either
a String (e.g. "my_mc") or a direct reference to the movie clip instance (e.g. my_mc).
Parameters that can accept more than one data type are listed as type
Object
.
newname
:
String
- A unique identifier for the duplicated movie clip.
depth
:
Number
- 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.
Example
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.helpexamples.com/flash/images/image1.jpg");
duplicateMovieClip(img_mc, "newImg_mc", this.getNextHighestDepth());
newImg_mc._x = 200;
newImg_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.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);
};
See also
removeMovieClip function
,
duplicateMovieClip (MovieClip.duplicateMovieClip
method)
,
removeMovieClip (MovieClip.removeMovieClip method)
escape function
escape(
expression:String
)
: String
Converts the parameter to a string and encodes it in a URL-encoded format, where all
nonalphanumeric characters are replaced with % hexadecimal sequences. When used in a
URL-encoded string, the percentage symbol (%) is used to introduce escape characters, and is
not equivalent to the modulo operator (%).
Availability:
ActionScript 1.0; Flash Lite 2.0
Summary of Contents for Flash Lite 2
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...