AS3 SNIPPETS
Snippets-short code examples without source
Movie Clip
- remove child
- link title
- link title
//prepare movie clip in library //put libraryButtonClass in class field in properties of movie clip var myButton:libraryButtonClass = new libraryButtonClass(); myButton.name="myButtonName"; addChild(myButton); myButton.addEventListener(MouseEvent.CLICK, removeButtonFunction); function removeButtonFunction(e:MouseEvent):void { removeChild(MovieClip(e.currentTarget)); //OR: //removeChild( getChildByName("myButtonName") ); //OR: //removeChild(myButton) //OR: //removeChildAt(getChildIndex(e.target as DisplayObject)); }
dfsfs