basically what i want to do is this:
I have a flash game on a page (pacman for example)
I want to be able to take a print screen of that game using javascript
Is it possible? I know i can include the game swf in a nother swf and capture the screenshot using flash but i need it to be done in javascript. is this possible?
If you control both the host page and the flash movie, then you can generate the screenshot in flash, and simply send it to javaScript, and then do whatever you need with it in javaScript.
In ActionScript:
And then in javaScript:
P.S. don’t forget to
allowScriptAccessfor embedded Flash, to allow Flash movie to access the javaScript on your page (which is definitely not wise if the Flash movie is made by a 3rd party).On the other hand, if you do not control the flash movie (for instance if you wanna make a website that’ll host 3rd party Flash games) then you’re out of luck, and what you need is not doable with javaScript alone, and it can only be achieved through use of browser plugins/extensions.