03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following use of r<strong>and</strong>om() returns a value of 0, 1, 2, 3, or 4: r<strong>and</strong>om(5);<br />

See also<br />

r<strong>and</strong>om (Math.r<strong>and</strong>om method)<br />

removeMovieClip function<br />

removeMovieClip(target:Object)<br />

Deletes the specified movie clip.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 4<br />

Parameters<br />

target:Object - The target path of a movie clip instance created with<br />

duplicateMovieClip() or the instance name of a movie clip created with<br />

MovieClip.attachMovie(), MovieClip.duplicateMovieClip(), or<br />

MovieClip.createEmptyMovieClip().<br />

Example<br />

The following example creates a new movie clip called myClip_mc <strong>and</strong> duplicates the movie<br />

clip. The second movie clip is called newClip_mc. Images are loaded into both movie clips.<br />

When a button, button_mc, is clicked, the duplicated movie clip is removed from the Stage.<br />

this.createEmptyMovieClip("myClip_mc", this.getNextHighestDepth());<br />

myClip_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg");<br />

duplicateMovieClip(this.myClip_mc, "newClip_mc",<br />

this.getNextHighestDepth());<br />

newClip_mc.loadMovie("http://www.helpexamples.com/flash/images/<br />

image1.jpg");<br />

newClip_mc._x = 200;<br />

this.button_mc.onRelease = function() {<br />

removeMovieClip(this._parent.newClip_mc);<br />

};<br />

See also<br />

duplicateMovieClip function, duplicateMovieClip<br />

(MovieClip.duplicateMovieClip method), attachMovie (MovieClip.attachMovie<br />

method), removeMovieClip (MovieClip.removeMovieClip method),<br />

createEmptyMovieClip (MovieClip.createEmptyMovieClip method)<br />

98 <strong>ActionScript</strong> language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!