Jump to content
Search Community

Tweens interrupted when browser window focus is lost

krancis test
Moderator Tag

Recommended Posts

Does anyone have experience with this issue?

Scenario:

A scripted animation is running in one of many open tabs in a browser. Switch to another tab and come back to the one with your TweenLite animation and things are out of place.

I've seen this happen with both AS2 and AS3 animations. It seems to be related to delayedCalls and delays within a tween.

 

I do realize how generic this question is and that there's no way to detect if the window your Flash file is in has lost focus (unless you spawn a new window from the Flash file)

Just wondering if any of you have come across this before.

 

Thanks.

Link to comment
Share on other sites

Tough to say without seeing an example, but it sounds like an issue caused by the Flash Player dropping to 2fps in some browsers when the tab is switched away. It's a way to save CPU cycles and the Flash Player does it automatically and it has nothing to do with GreenSock stuff. And it's not that it causes any problems with TweenLite/Max per se - in fact, they're almost immune from it because they're time-based by default (as opposed to frames-based). But if you have a frames-based animation (like a MovieClip) that you expect to be synced with a TweenLite tween, they won't remain synced because the TweenLite stuff will honor the original timing whereas the frames-based MovieClip will slow down drastically while the tab is inactive. So technically the problem is with the non-TweenLite stuff :)

Link to comment
Share on other sites

  • 9 months later...

Just a quick post to say that I'm experiencing the same problem, in a movie using dynamic tweens controlled by TweenMax and TimelineMax. Open a new tab, return to the tab with the movie using the tweens, and the tweened clips are all over the place. Because this is work for a client I don't have a URL I can send right now; but it is potentially a huge problem, because the movie will be useless if people can't browse through tabs without it going haywire.

 

Would a solution be to kill all tweens if tab focus is lost? What's the easiest way to do this?

Link to comment
Share on other sites

OK, have just found and read your comments on this thread: http://forums.greensock.com/topic/3974-flash-101-in-hidden-browser-tabs/

 

Good to see that you've recognised and addressed the issue. The end of your last post on the thread looks mangled though. Could you please let me know exactly where to go to download the update that resolves the 'short tweens' issue?

 

(I'm not a Club GS member - is it a free download?)

Link to comment
Share on other sites

The fix that GreenSock performed would effect the free public version of the greensock classes. Are you using the latest version? You can get it here:

http://www.greensock.com/tweenlite/

 

If your problem persists, please create a simple sample file that illustrates the problem and attach it to a response. it doesn't have to include any of your client's assets. The simpler the better.

 

Carl

Link to comment
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.
×
×
  • Create New...