问题
How to pause flash application in browser if there isn't any buttons that would allow it ?
回答1:
Well, there is a website, there is a swf file, i want to pause it.
Do you have access to these files and their source? Is it on the same domain?
Anyway, the previous two answers suggested wrapping the swf with another Flash application and then setting the framerate to 0. That's not accurate, because the minimum framerate you can set is 0.01. Flash code is built around the framerate, it makes sense. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#frameRate
If you have access to the original files you want to pause, the proper way to accomplish this would be through ExternalInterface
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html
http://www.viget.com/inspire/bi-directional-actionscript-javascript-communication/
回答2:
yes by adding this stage.frameRate = 0;
pause flash
Pause-Game-Using-stage-framerate
pause using javascript
回答3:
Your question is a little vague, I'm a little confused at exactly what you want. I did find something that MIGHT help in this question. But here's what I saw that might help you out:
Embed an swf, that'll load the game. Then you'll be able to have some control, because the loaded SWF is running in the same instance as the loading SWF. For most games, it should suffice setting the frame rate to 0.
So setting the frame rate to 0 is essentially pausing it... But I would be able to provide a more detailed answer if you clarify your question a bit more.
来源:https://stackoverflow.com/questions/9619276/how-to-pause-flash-application-in-browser