Skip to main content
Known Participant
October 5, 2020
Question

how to remove an addchild for button event

  • October 5, 2020
  • 1 reply
  • 152 views

for(var i=0;i<24;i++) { /////////////// BtCerto.push(a[i]) /////////////// var Bt = new lib.objetos; this.addChild(Bt); Bt.on('click',Veri.bind(this)) Bt.on("mouseover",function(e){ this.cursor = "pointer"; }); }

    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    October 5, 2020

    to remove an object from the display, call removeChildF()

     

    import flash.display.DisplayObject;

    function removeChildF(dobj:DisplayObject):void{

    if(dobj && dobj.parent){

    dobj.parent.removeChild(dobj);

    }

    }