views:

13

answers:

2

I'm using TweenLite class (AS3), I have very big project, should I removelistener of timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); in Tweenlite.as file, after my animation is complete????

Because of big project, i'm affraid that ENTER_FRAME causes memory leak for my project.

Thank you

A: 

Probably not, although you can always ask the question to Jack Doyle at greensock.com. What's your coding environment? Do you have a profiler? It would make more sense to run some tests and do some profiling before engaging in modifying TweenLite, especially since you have a big project.

By the way, your accept rate is pretty low, maybe you should fix that ;)

PatrickS
You made me smile dude ;) Ok i will ask Mr Jack. I use flash cs4, codding in flashDeveloper. One question, there are hundreds of Tweenlite.to calls i make in my project, each of them do not have removelistener for updateAll function inside class, I think it's stupid :D What you think? Why probably i may skip removeListener as you say???
Almas Adilbek
As a Mac user, I'm not familiar with FlashDevelop but I think FD has a profiler. If it does, I suggest you do a little profiling before worrying about memory leaks. If you can pinpoint issues with Tweenlite, then you should ask Jack ;) More seriously, note that the listener uses weakReference.
PatrickS
A: 

You do not need to remove the event listener manually. The last argument, useWeakReference is set to true so your object will get garbage collected even with the listener present.

Read more here: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/events/IEventDispatcher.html

grapefrukt
Thank u man ...
Almas Adilbek