Porting Complete AS3 project with FLAs to OpenFL; How OpenFL Supports Flash Assets (fla, swc)

I’m arriving at OpenFl after having to deal with poor flash performance in the NPAPI plugin, as well as on poor computers, and no support from Adobe. I think I can safely say they don’t care much at all about their product.

So my goal is to be able to deliver this project (game) I have using HTML5. It’s a fully completed game an consists of an FLA with a timeline, movieclips on the timeline, and about 1/4 of the game’s code is situated on the timeline.
I can either compile the entire project from the FLA using Animate CC, or I can compile half of it using Animate, and the other half using Flash Develop which makes use of some assets in swc 's.

  1. What’s this? OpenFL CC plugin out of date or something
    A plugin for Animate CC to directly publish to HTML5? I think I’d better like to migrate to barebones programming from haxedevelop, storing any new game assets as bare png and wav files floating around than encapsulating them in the fla.

  2. From my understanding of reading multiple articles about openfl and haxe, I’ll be able to access assets contained in fla 's or swc 's or even swf 's, but I won’t be able to run timeline code?

  3. Will I have to remove all my code from the timeline and re-code it as classes that use assets from the fla?

  4. Will the existing code I have that compiles to a swf in flashdevelop that makes use of resources in swc 's seamlessly work in openfl if it doesn’t use things that openfl doesn’t currently have? (Basically is this type of resource loading perfectly supported)

  5. How do I go about the porting process. Should I use as3hx to refactor my code into haxe and then use F&R to refactor the API calls from haxe flash API to openfl API?

Are there documents on how to port into OpenFl that I missed somewhere?

Thank you to everyone who contributes: for helping me, and possibly future people who stumble upon this thread using a search engine.

1 Like

OpenFL 3.5 (released) has support for SWF assets built-in. The plugin for Adobe Animate is optional, exporting a normal AS3 SWF from Animate should work fun, and perhaps marginally better with the latest improvements.

Most graphics are supported, object names, custom base classes and even extended SWF-based classes work. It’s really the SWC workflow, but you reference the SWF instead of the SWC in <library path="my.swf" generate="true" preload="true" />

Support for (what Adobe calls “framescript”) is planned, but not supported. In the future, Haxe on the timeline may work (another reason for the custom plugin eventually) but currently sound, morph tweens, ActionScript and some other features are not supported.

There’s some information here:

http://books.openfl.org/as3-conversion-guide/

…which might help with porting :slight_smile:

Some features from Flash are not supported, like video is not supported outside HTML5 right now, for example.

The good news, though, is that you will still have Flash support, so you don’t lose anything, but we can work together to help things continue to run better on HTML5 and native desktop or mobile :wink:

Thanks for the warm welcome @singmajesty :slight_smile:

But, even though I’d be able to compile to Flash… I wouldnt be able to make use of the framescript or compile it using haxe unless I pre-compile it using Animate CC. So I would lose that until I port that code over into classfiles :slight_smile:

What an amazing community of projects. I spent the entire past 2-3 days just reading about all the wonderful stuff about HTML5 development, Haxe, and OpenFl :slight_smile:

Maybe one day I’ll be able to contribute something back to the community. If I am successful in porting the project into haxe/openfl I’ll definitely contruct a guide of how I did it for newcomers. :slight_smile:

Hmm…

It’s funny actually I visited everything except for Books in the learn section. Maybe I think books are boring. I’m trying to think of a way that would’ve had me find your guide before creating a forum topic asking about it.

Also how do I join the slack channel?

… Does the Introduction section delibrately lack a “Migrating from AS3” section with perhaps a link to your book because there wasn’t really any work put in to automate such a transition? That would pretty much explain it, since all we might have are stuff other people made such as as3hx, and of course framescripts arent migrateable.

Books feel like something to do with the language and not really containing a guide for migrating at least for me.

Oh my, the short history section of your book, more specifically the first 3 paragraphs I have just read really put things into perspective. Before reading them I was under the assumption that haxe did not emerge directly as a result of wanting to compile actionscript into multiple targets. Before I even learned that haxe is similar to actionscript I totally thought it was its own custom thing for developing for multiple platforms.

Great work! :blush:

It’s all a work in progress! I agree, more work on the guide, and links from the main learn section would be helpful!

Try this link for Slack: http://openfl-slack-invite.herokuapp.com

We do support the undocumented movieClip.addFrameScript function, which should help with migration from the Flash timeline to keeping code out of Adobe Animate.

Please let me know how I can continue to help :wink:

Hi, Is it possible for you to provide link of the game or application you are trying to port ?

By the way, it doesn’t matter if your code is in timeline. But yes, the efforts increase because, first the timeline code needs to be put into classes. And then you can proceed for Flash to Open FL conversion.

Also, about swc files. I think, that won’t work in Open FL. Because swc are after all precompiled actionscript code only.
You will need to convert the code generating the swc into Open FL’s code separately.

Also, for example, if it’s a 3rd party swc, say greensock’s tweening, then it won’t be practicable to port it. In that case, all the tweening will need to be translated into Open FL compatible tweening, using Actuate library.