Steven said "event.currentTarget"
Leandro said "emitter.parent"
Thanks guys!
I think the removeChild is working below (event.currentTarget), but now I'm
getting the "Cannot access property or method of a null object reference"
which is usually what happens when the EventListener is calling a
non-existent object. Can you suggest a change for the first line to remove
the event listener properly?
Thanks again!!!!
emitter.removeEventListener (Event.ENTER_FRAME, removeDead); //NOW
I THINK THIS LINE IS WRONG
event.currentTarget.parent.removeChild(event.currentTarget);
Code for reference:
> function removeDead(event:Event)
> > {
> > if (emitter.pParticle.pArray.length == 0)
> > {
> > trace ("No more particles");
> > ***** parent.removeChild(emitter); // THIS LINE NEEDS HELP-- DO
> > YOU
> > KNOW WHAT PATH WILL REMOVE THE ABOVE EMITTER INSTANCE?
> > emitter.removeEventListener (Event.ENTER_FRAME,
> > removeDead);
> > }
> > }
> >
> > }
>
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders