Reputation: 2199
I wonder if it's possible to add an Event Listener to a MovieClip that fires everytime a child is added to it or removed from it.
Is this possible?
Thank you in advance,
Matteo
Upvotes: 0
Views: 81
Reputation: 1542
You can override addChild / addChildAt and removeChild / removeChildAt functions and dispatch any event You want :
public override function addChild(child:DisplayObject):DisplayObject {
dispatchEvent(new Event("newChild"));
return super.addChild(child);
}
Upvotes: 1