From Animate to… what?

So I posted this text in the Haxe community, and was recommended to move here by Allan Dowdeswell:

”Except for AS3, I have absolutly no experience of coding games. I’m a graphic designer who found Adobe Flash 20 yeras ago, and then spent many years learning AS3 and had a platform for childrens games online. After Flash was banned I was devistated and gave up everything.

But now I really miss creating these funny games and I want to give it a try again. I’m pretty comfy with AS3, and AI suggested me to consider Haxe. So I went googling Haxe/Openfl, Starling, Feather and a bunch of game engines etc. But I still don’t get it. I want to make apps which looks good on a high res screen, like Ipad Pro. I don’t want a HTML5/js game, or to be locked in to an expensive game engine, or to spend the rest of my life try figuring out what the skilled game makers taIk about. There is no speed, collisions or multiplay in my games, but a lot of movieclips and soundfiles.

So I have all that stuff and AS-files in Animate, where I easily can control and test all functions. My coding skills are limited but sufficient for the type of games I do. But then what? Convert mc:s to sprites and wrap it all into Air (and get low-res images?) Or should I convert the AS-files to Haxe? I think I’m capable to rewrite it if needed. But is it worth the effort, and where do I go from there?

It seams to be a thousend ways of migrating to various game-making universes, and a million stars out there who contributes with their own bits and pieces for all kind of solutions… but not a single over all map to be found.

So what is the smoothest way (for a non-skilled programmer) to go from AS3/Animate to a functional game and beyond to Ios and other app stores? Excuse me for asking these silly basic questions. But I’m really eager to learn, if someone just suggested a smart way to go.”

Answer from Allan (links removed, I’m not allowed to use them yet):
”Hey @Interester I’m glad you are giving Haxe a shot. Your question might be more appropriate for the OpenFL forum because that would be the best option for a Flash refugee. I also was a graphic designer well-versed in AS3 who migrated to Haxe/OpenFL when the writing was on the wall for Flash. While there are many options out there, as I’m sure you are aware, there are lots of success stories of developers converting from Flash. Poptropica and FlowPlay come to mind.

There is no single overall map because each project has unique features and needs. One big question I would ask is how did you build your animations? Tweens: try (github link). Spritesheets: try OpenFL Tileset/Tilemap or other solutions. Timeline: OpenFL can load swf at runtime as an asset, or else convert it to Haxe classes. That could be a big time consideration so you might do well to figure out your solution to that, along with whether you need to rebuild graphics. By the way, OpenFL supports SVG if your art style supports it.

It sounds like you maybe built your own game engine. Again, depending on your needs you might consider Starling or HaxeFlixel which have heritage from AS3. The latter is quite popular nowadays.

As far as the language goes, (here is a concise summary of the differences between AS3 and Haxe). There are a lot of AS3 conversion tools but I have found that the Haxe compiler gives a lot of good feedback and it will help you to learn as you fix this and that. You will find that the OpenFL Samples repository can be a good place to get familiar with OpenFL, especially for building things from scratch.”

I think a good start is to try migrate two easy projects with short and straigt forward AS-files. One is a simple xylofon that you can play with either mouse clicks or keyboard. And another where you can click on different instruments that play well together (e.g like in Demo - Incredibox ). Every instrument is a button/movieclip which mooves in pace with the music. I dont’t remember if I used tween, all my Flash projects are stored in an old Imac in a wardrobe and must be manually moved, opened and exported from an old version of Animate to the newest version… before I can work with it. Jumping from Flash to Animate will need a lot of time figuring out new ways of doing things. So thats the first step. Sound is importent in my playgrounds so finding the best solutions for that i crucial. Tweened movieclips can either be changed to frame by frame or handled by Actuate, am I right? SVG is importent for scaling all my vector images to different devices.

I guess next step after that is to find suitable packages and libraries to import? I don’t know if I have built a ”game engine” (that’s why I’m so lost in your world). I use a lot of brush painting with color picker, or e.g ”ketchup” (filter for blur, bevel, emboss, shadow etc) or e.g ”whipped cream spray” (bitmap, whereas I remembered there was garbage problems when you had too much cream on a cake :-).

I would appreciate any advice for how to proceed with these projects and learn how to remake my old games.

Hello and welcome !

Giving a complete answer to such a post is quite hard so forgive me if I miss/forget something ^^

Haxe is a language and compiler but unless you build your own framework/engine you can’t do much with haxe only. If Flash was a planet, Haxe would be a galaxy : it has many “planets”, many very different engines built on top of it. OpenFL is one of those, and it’s the closest thing to Flash you will find in the Haxe galaxy.

OpenFL stands for “Open Flash”, it replicates most of the as3 API and works exactly as you would expect. It sits on top of Lime but you don’t have to bother with that.

Flash didn’t really disappear by the way : the animation tool is now called Animate but as far as I know it should still be able to run your games ? It can also export to desktop and mobile using AIR so if you really don’t care about web at all maybe you should consider sticking with it ? Only flash player died, AIR is now maintained by Harman and shows a splash screen unless you buy a licence (199$/year if I remember correctly).

I’m in love with Haxe for 7 years now but I have to say that AIR is still here :slight_smile:

Haxe language is very similar to as3 with some differences (most of which should be found here : Introduction · OpenFL ActionScript 3.0 Conversion Guide) but you should feel comfortable with it real quick. There is a lot more possibilities with haxe than there are with as3 but you don’t need to learn about them to use haxe the way you used as3.

If you used to code inside movie clips : you can’t do that directly with OpenFL, but you can use movieClip.addFrameScript(frameIndex, someFunctionName)
I don’t have any experience with that so I can’t comment about it.

You will most probably want to use the SWF lib https://lib.haxe.org/p/swf/ I don’t have any experience with it either so can’t comment much.

First step is to download and install Haxe if you haven’t already : don’t necessarily get the latest version as there is often a delay between an haxe release and all libraries being updated for it. Personnally I use 4.3.6 and would recommend that.

Then follow instructions here to install OpenFL and its dependencies Download OpenFL

Then choose a code editor, VSCode is a popular choice now

Then start playing around, maybe try to port one of your simplest games and don’t hesitate to come back with more questions !

1 Like

Haxe is very powerful, but as an ex flash creative, I would almost suggest you experiment with haxe JS initially and even try some WebGL. OpenFL is great but I feel that it can hide you from getting to grips with creating in haxe raw code and from understanding stuff like creating your own spritesheets and shaders… which sound scary but the deeper you go the better you can use openfl or another haxe toolkit, and JS is often the easy route compared to C++/hashlink or less maintained targets like jvm, just try to properly type and avoid dynamic as it will make it easier long term to have good working stuff. As an artist you have to have some pain and accept some structures before you can create easily again, soft option is fitting your code in OpenFL, the hard option is to create code solutions to work on multiple games toolkits, webgl, canvas - But in doing so you learn and improve more, so even if you focus on just OpenFL be mindfull and observant for other game toolkits, as it will make your solutions more useful. Starling in OpenFL is a facebook attempt at Stage3D ( Graphics Layer, WebGL/OpenGL ) and feathers is on top, and so too openfl Away3D and Feathers, but it is not ideal and likely fb stage3d will get replaced. I say this as I know other haxe games toolkits can run faster on WebGL and OpenGL (or more advanced/currrent c++ approaches). I think Flash was amazing for it’s time and actually well beyond when it died… but Haxe is a better programming language than as1/as2/as3 an Swishscript, in fact it is better than TS and even Swift and C#. OpenFL allows some access to swf, but some consideration is needed… maybe it is not the way to make a fast creative app and with openfl as a creative you can find better structures.

1 Like

I like the descripton of the coding Universe, thanks a lot. It’s going to take me weeks to consider and try out everything, but now I have a very good starting point. The OpenFl hand book will be my bedtime litterature onwards. I found out that most of it, e.g packages, classes, events and functions feels very familiar and the fact that I have no actionscript inside my timelines and movieclips will make the transition easier.

I know that Air is a shortcut to lounching my games, but I don’t want to be locked into a companys terms, fees or splash screens (like I’m stuck with Adobe and Apple for now). So I prefer the world of open source, but Air is my plan B if things go wrong.

I really appreciate all support and hope to be able to boil everything down to more specific and detailed questions as time goes by. One more generic question, though: When I browse through Apples app development resources neither Haxe/OpenFl nor Air is mentioned anywhere, just a lot of references to e.g Swift and C++. So what is the procedure when my Haxe-projects are ready for launching to an app store?

Glad I could help a bit !

I totally agree with you about getting open source freedom : it feels so good !
Also using OpenFL you can totally create AIR apps, and they will even run better than if you wrote them in as3 because the Haxe compiler outputs faster bytecode.

I published quite a few AIR apps to iOS : it doesn’t matter what your app has been made with as long as it complies with Apple requirements. I have no experience publishing to mobile with OpenFL but I know it works.
You’ll need an Apple developer licence, and access to a mac that is up to date enough that it can upload your app to the app store.

EDIT : forgot to mention there is an OpenFL Discord too OpenFL with a channel dedicated to the SWF library that you might find useful

1 Like

It’s not going to be a walk in the park, haxe isn’t flash. You’ll feel almost at home regarding coding “almost”, especially if you go for the haxe+hxcpp+lime+openfl combo but again it’s not flash… Some key flash features are lacking, such as pretty much everything video for instance, the movieclips aren’t really a thing, there are ways to integrate and use them but that’s not something I would recommend using at all, it’s more of a feature to help dealing with legacy flash assets when you’re stuck with those than anything else. And the Flash “vector engine” doesn’t exist; flash was a powerful vector animation tool, haxe even with hxcpp and lime and openfl isn’t. But you can use SVG if you really need vector graphics…

Personally I mostly use spritesheets and bitmapdata manipulation, that part is reliable, it’s almost exactly just like with flash AS3 back in the day. Sound handling is OK too, good enough. For the 3D side of things there’s Away3D that surprisingly still works pretty well but there are no 3D Physics engine available from haxelib except oimophysics (10 years old) Search for "3D physics" and it’s not handy… And for animated models you have to go for MD5 models… It’s special, but you still certainly can make a nice minigolf game ! :sweat_smile: Don’t expect too much out of it. As an alternative for 3D you can go for Heaps that relies on Haxe Heaps - Haxe Game Engine - Heaps.io Game Engine but it’s a tad a pain in the ass to setup and requires to be really comfortable with coding, not a starting point I would recommend for you right now.

HaxeFlixel exists also, and is still maintained I believe, it works pretty much just like Flixel with Flash.

For vector handling, there’s the SVG lib but that’s limited… It’s a better than nothing kind of stuff Search for "svg"

If you plan to export your project as an android app it’s doable, it worked pretty well several times last time I did it with various versions of haxe, it was a couple of years ago and I remember that setting up the android part of things for export wasn’t exactly straight forward, it required a couple of adjustments but in the end it worked, and worked well. For iOS export you’ll need a Mac a MacOS with Mac dev tools installed if memory serves…

Right now regarding export you can go for HTML and native platform C++ executables (either linux or windows depending on computer environment/OS) and it works right out of the box after installing haxe+hxcpp+lime+openfl.

CONCLUSION: Start by compiling a simple example project and export it to HTML C++ and make sure that part is OK. Once that works, test the features you’ll need such as sprites, sounds, fonts, graphics, etc… To make sure you don’t get a bad surprise down the road such as “oh damn, that flash feature doesn’t exist and half my project relies on it”. That’s a good start. And eventually, I guess you’ll end up having to re-make your old projects, as in a “new version for haxe” that is almost like what they were in flash. That’s not going to be a one click straight forward conversion, forget about it.

If I understand you correctly the first hurdle is that you created your games in Flash (Animate) and did not use any IDE like FDT or Flash Develop.

I guess it was easier for me to move from AS3 to Haxe / OpenFl back in the day, because I had my FDT coding workspace separated from *.fla and *.swf files, which I occasionally used as graphics libraries, if at all.
So like mentioned above you should follow the starting guide an learn how to create and compile a simple test project.

If you don’t have too much code inside your *.fla files but mostly in AS3 class files, you could try to convert a small project. That worked pretty well for me.
I „just“ had to follow the OpenFl starting guide, checked and compiled the sample project, then chose my least complex project, converted the AS3 files with as3hx and did the necessary changes (Overview · OpenFL ActionScript 3.0 Conversion Guide).
It was still a rollercoaster of emotions. Sometimes I could make huge progress in a very short time, only to get stuck somewhere else and stumble over pitfalls. But it was absolutely worth it!

And if it is not absolutely necessary, I would avoid using swf files. I gave it another try few years ago, in a small project when I was too lazy to use spritesheets, but it turned out as a dead end for me (Getting custom class names of nested MCs from SWF).

Most important: have fun and enjoy open source coding freedom! :smiley: