Example
In the following example, a new movie clip instance is created called
An image is
img_mc.
loaded into the movie clip, and then the
clip is duplicated. The duplicated clip is
img_mc
called
, and this new clip is moved on the Stage so it does not overlap the original
newImg_mc
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 Player 5
Parameters
- The expression to convert into a string and encode in a URL-encoded
expression:String
format.
Returns
- URL-encoded string.
String
52
ActionScript language elements
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?