Removing an object after addChild

Removing an object after addChild
0.0 0


Hi all,

I am trying to remove an object that I have added to a layer with no success.

Basically I am adding a layer object with

       this.popup = Popups.Create(data, [this.onWorldKillPlayPopup]);
        this.popup.tag = 123;
        this.addChild( this.popup,100 );

The tag = 123 is just a simple test I have done to try all options. The popup class is extended from a layer.

Now when I have finished with this I am trying to remove it from the parent layer ( this )

I have tried all options…

this.removeChild( this.popup, true );
this.popup.removeFromParentAndCleanup( true );
this.removeChildByTag( 123 );

But I just cannot seem to remove the popup layer.

Thanks in advance for any help.


OK ignore this post. I realised I was actually calling back on myself :slight_smile:

My actual popup class was the actual caller to the function who was trying got kill itself :slight_smile: DOH… I shouldn’t write code after a few bottles of wine :slight_smile: