Guides · ActionScript to HTML5
Your ActionScript, running in the browser
The hard part of moving a Flash game to HTML5 has always been the code. Reflyt doesn't ask you to port it: the game's own ActionScript 1, 2 or 3 runs in the converted copy.
How the code keeps working
A SWF holds the game's compiled ActionScript. Reflyt reads it from the SWF and runs it in a small JavaScript player that ships inside the converted folder. ActionScript 3 bytecode is compiled to JavaScript in the browser as the game runs. ActionScript 1 and 2 run the same way the old player ran them, timeline by timeline.
The art, sounds and timelines are converted ahead of time into web files, so the player only has to run the code and draw.
What the player covers
- The display list, timelines, buttons and events
- Text fields and fonts, including Flash's newer text engine
- BitmapData, filters and blend modes
- Sound and music
- Saved data (SharedObject), kept in the player's browser
- GPU 3D (Stage3D), drawn with WebGL
Tested against real Flash
The player is tested against what Adobe's own Flash Player 35 does with the same files, not against what we think should happen. About 97% of Flash games that work in Adobe's Flash Player also run in Reflyt on the first try. That was tested blind on 2,694 such games picked at random. "Works" means the game starts, answers clicks and shows no errors on its first screens, so play your free preview all the way through before you buy.
What it won't do
It won't make web requests or run scripts on the page around it, for safety. Links open only if they're plain web or email links. Multiplayer games that need their old server and Adobe AIR desktop apps aren't supported.
Questions
Do I have to rewrite my ActionScript in JavaScript?
No. The game's own code runs in the converted copy.
Does it support ActionScript 3?
Yes. AS3 bytecode from the SWF is compiled to JavaScript in the browser as the game runs.
What about ActionScript 1 and 2?
Yes. Old timeline games with AS1 and AS2 code are supported too.
Can I edit the code after converting?
The converted copy runs the game's original compiled code. If you want to change the game, edit your source and convert the new SWF.
Does it work without the .fla or .as files?
Yes. Everything comes from the SWF.
Will ExternalInterface calls to the page work?
Not as JavaScript calls into your page. For safety, a converted game can't run scripts on the page around it.
How do I try it?
Drop a SWF on the home page. The preview is free.