I am having a flash game which i need to convert to a html5 game . Can you help me how to convert it. i tried of doing it as per instructions and commands in the blog , that output is that it is playing as a slide show but not as a game. please suggest me how to start and complete in order to get the game
Which blog article are you referring to?
There are two distributions of OpenFL, one for Haxelib, one for NPM.
The Haxelib version supports Haxe only.
Both support a SWF converter for importing resources from SWF files. Neither supports using ActionScript code embedded in an existing SWF file right now.
You can check out the “demos/NyanCat” project in one of the above repositories above for an example of using a Flash animation. There’s also a “SimpleLayout” example that uses multiple resources from a SWF file by name. We support linkage names, simple animations, dynamic text and many other features (but no embedded ActionScript bytecode)
Please let me know if there’s anything more we can do to help
Hey @singmajesty and all
I am totally new in Openfl and other things, i was little bit lost about this stuff i try sample that provided example nyancat project, is the nyancat is only animation ? not full game ? if i replace nyancat.swf with other swf file is it require some manual code in main.hx ? when i replace the nyancat.swf and test it with flashdevelop it just show blank.
i try usingSWFAssets too, i already process and generate .bundle folder from swf games but i don’t know how to use it properly, i read and test it Building .bundle at runtime and i fail,
the goal i learning is i want to convert from swf flash games to html5.
Hope soon i understand what i learning
please let me know if there’'s any tutorial step by step to porting swf to html5.
You will (ideally!) need to be able to have the original ActionScript sources for your Flash project.
A final Flash SWF may contain fonts, graphics, sounds and compiled ActionScript code. We currently have support for most SWF graphics in OpenFL, with ways to link it to your code. The Shumway project is the most mature solution I know to play a SWF file as-is (with no modifications), but there are some serious problems with that approach. Performance is an issue, but shipping real products often requires changes to your code.
Here’s a blog post from someone who tried to use Shumway recently, there may be other stories of success or failure: https://dev.to/elmuerte/shumway-shiv-scant-success-o1a
Going back to see if you have source code for your Flash SWF project will go a long way to helping know what your options are.
Thank you for quick replay
i have fla file and some only swf files, i would like to convert games with A SWF decompiler as this is not ideal,
do you have any idea what option i have ?
JPEXS looks promising since it is free/open-source, so I would probably start there. I’ve used Sothink with a license before, and there probably are some other choices out there as well. Sometimes they can convert compiled ActionScript bytecode into something legible that could be re-compiled again
After using JPEXS what should i do ? should i use as3hex ?
Yes, I believe you can use
as3hx to convert ActionScript 3.0 code to Haxe. It does about 95%-98% of the conversion automatically, though it helps to understand some of the basics of the difference between the Haxe and ActionScript. Some of this is documented here: https://books.openfl.org/as3-conversion-guide/
I’ve converting it to hx using as3hx, what next step ?
Create a new OpenFL project:
openfl create project ProjectName cd ProjectName openfl test neko
You can drop the converted Haxe code into the “Source” directory of your new project, and can run it again.
I also recommend having Visual Studio Code and the Lime extension installed, so you have a good Haxe code editor. There are other options available, but that’s what I use
There will probably be minor compilation issues. I just helped someone on this thread with some. This older blog post may help with some issues you’ll experience, and of course, there’s the forums here and Discord for help as well.