开发者

Removelistener of timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);

I'm using the TweenLite开发者_如何学JAVA class (AS3) and I have a very big project. Should I removelistener of timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); in the Tweenlite.as file, after my animation is complete?

Because of the size of the project, I'm afraid that ENTER_FRAME causes a memory leak for my project.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜