Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
creatify

Information on how you're using ENTER_FRAME Events?

Recommended Posts

We're working on a very niche project with a somewhat customized version of the Flash Player — I can offer more details if necessary.

 

One of the leaks appears to happen when we attempt to utilize an ENTER_FRAME event, and if that same event is added a second time after it has already been registered. Consider this as an example:

 

 

function onFrm(e:Event):void {

}

addEventListener(Event.ENTER_FRAME, onFrm);
addEventListener(Event.ENTER_FRAME, onFrm);

 

My question is, within the core of TweenMax, knowing that we're using tween overwrites, are there many cases where that scenario may happen within the engine? I figured I'd ask here before I started digging deep into it all. If this does have the chance of happening, I can probably customize the engine to utilize the following which appears to resolve this issue we're having. I realize this could impact performance, but that's less of a concern than the memory issue.

 

if(!hasEventListener(Event.ENTER_FRAME)) {
addEventListener(Event.ENTER_FRAME, foo);
}

 

Thanks!

Link to post
Share on other sites

Nope, the entire engine is driven by a single ENTER_FRAME handler. The listener gets added once at startup and that's it.

 

I hope that's good news for you :)

 

Good luck on your project.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×