Flash Player 5.
my_mc.removeMovieClip(): Void
None.
Nothing.
Method; removes a movie clip instance created with duplicateMovieClip(), MovieClip.duplicateMovieClip(), or MovieClip.attachMovie().
You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.
Each time you click a button in the following example, you attach a movie clip instance to the Stage in a random position. When you click a movie clip instance, you remove that instance from the SWF file.
function randRange(min:Number, max:Number):Number {
var randNum:Number = Math.round(Math.random()*(max-min))+min;
return randNum;
}
var bugNum:Number = 0;
addBug_btn.onRelease = addBug;
function addBug() {
var thisBug:MovieClip = this._parent.attachMovie("bug_id", "bug"+bugNum+"_mc", bugNum, {_x:randRange(50, 500), _y:randRange(50, 350)});
thisBug.onRelease = function() {
this.removeMovieClip();
};
bugNum++;
}
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/00001549.html
Comments
dougconing said on Sep 20, 2004 at 10:38 AM : hypoStiller said on Nov 9, 2004 at 1:21 PM : murk379 said on Nov 25, 2004 at 8:13 PM : Sardok said on Mar 9, 2005 at 7:16 AM : areohbee said on Apr 6, 2005 at 8:47 PM : sethrd11 said on May 16, 2005 at 9:49 PM :