event listener question


assignednotownedbox.addchild(notmytickets);

assignednotownedbox.addeventlistener(mouseevent.click,_root.selectticket,

false, 0, true);

 

if add childeren way.. , have say.. 5 or 6..

i remove children calling removeallchildren();

but

how remove eventlistener when calling removeallchildren();

 

do listeners remove removeallchildren();  call ?

removechild()method

public override function removechild(child:displayobject):displayobject

      removes child displayobject child list of container.    removed child have parent    property set null.    child still exist unless explicitly destroyed.    if add container,    retain last known state.           

 

if no longer need event listener, remove calling removeeventlistener(), or memory problems result. objects registered event listeners not automatically removed memory because garbage collector not remove objects still have references.

 

a strong reference (the default) prevents listener being garbage-collected. weak reference not.  

so have remove eventlistener manually after removeallchildren()



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???