Hello Erik,
I always try to clean every addEventListener I put in my code, but, as you said, Timer, Stage and EnterFrame events are in fact the ones that cause the problems. In fact this little application is useful only for tracking event listeners that the programmer has forgotten to remove.
This can happen sometimes, at least to me ;-)
On the other hands, the application is useful also to get a sense of the code written by third parties in the case you have to load their assets in your main container.

Paolo


EECOLOR ha scritto:
If I recall correctly, the problem only exists with event listeners for
Timer, stage and EnterFrame event listeners.

Stage listeners are easy to clean up. If you ever attach a listener to the
stage, add it within the ADDED_TO_STAGE handler, make sure you remove it
within the REMOTED_FROM_STAGE handler. I am not sure, but I think using a
weak listener here would do the trick as well and would prevent you from
needing to remove it.

As for Timer and EnterFrame events, make sure you never run them forever. In
all cases I can think of, there is no need to let them run forever. Running
them forever is just lazy programming. If you have a usecase where one of
these would run forever I am interested in it :)

As for normal events, this has (as far as I can tell) nothing to do
with problem mentioned by grant.


Greetz Erik


On 4/28/08, Paolo Nicoletti <[EMAIL PROTECTED]> wrote:
Ok let's retry... plain text this time.

Hello there,
After having read that post you signaled (and the ones related to GC
issues), I wrote a really simple Air application that scans one or more
directories for actionscript files and checks their content to see whether
or not every addEventListener has a corresponding removeEventListener set.
You can find it here:
http://www.genereavventura.com/app/addeventseeker/index.html
Sometimes it can be useful.
Paolo

P.S. I apologizes for having sent this message twice...

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
Change Signature

Murphy's First Law: Nothing is as easy as it looks.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to