I’m looking for a code to stop all flash animations on a web page when this page/tab is not focused or active. Because this problem causes performance loss at any computer.
Any solutions with As3 or javascript?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is possible to stop them all, but it is harder to resume them afterwards depending on how your code is organized, use this function to stop all movie clips:
Then to stop all objects you would do:
stopEverything(stage);.Note that this is only stopping MovieClip animations, all EnterFrame events will still be called.
Another smart option is to verify that the application lost focus and then do
stage.frameRate = 1;, and once focus is gained again you can set it back to what it was.