1

Can any one tell me, how to convert a existed fla or swf to Haxe readable (.hx and .nmml)? I want to deploy it on ios device. and can edit the source code(I know the process of deploying a Haxe project in ios devices, but wanted to know how to create a haxe project with existed flash project).Please suggest me regarding it, Thanks in advance.

2 Answers2

0

First of all, you can't do it.

You can convert as3 code to haxe by some tool. It's easy to write one and I did so some time ago. Also, there is at least one open source tool to do that. I'm not sure how good it is though.

Another thing is your graphics. I'm almost sure you can't convert .fla to graphics you can use on iOS automatically. But we have a framework similar to flash API used to deploy graphics on non-flash platforms, so there probably exists some tool to convert flash vector graphics to a format this framework will understand / rip it from .fla if the framework understands it on it's own. I'd be interested in comments on this issue.

stroncium
  • 1,430
  • 9
  • 8
  • please tell me step by step to convert AS3 classes(from a .fla project)in haxe. Because I am new to Haxe and NME. and how to create .nmml with the existing swf. – user1590042 Aug 17 '12 at 10:24
  • i linked you an open source tool to do that. this tool converts a folder with codebase in as3 to haxe. – stroncium Aug 18 '12 at 10:39
0

It's more complicated than merely opening a Flash project and compiling it with Haxe - they are two different languages, and if you're targeting iOS, two different environments.

However, there are similarities between AS3 (flash) and Haxe, so you may be able to copy some of your code across. Here are some useful links:

  • Using AS3 classes in Haxe - includes links to tools which can help automatically convert a ".as" class into a ".hx" class. It's not 100% perfect, but it's better than doing it by hand.

  • Using SWF Assets in NME - Cross Platform - Joshua Granick has a blog post about using compiled SWF assets in Haxe/NME, and it compiles to the C++ targets, including iOS.

Between converting ActionScript classes to Haxe, and using SWF assets, you may be able to make a fair amount of your project run on iPhone. Don't expect it to be a simple click of a button though. If you run into more problems, I recommend asking on the Haxe mailing list or NME Forum.

Jason O'Neil
  • 5,908
  • 2
  • 27
  • 26
  • please tell me step by step to convert AS3 classes(from a .fla project)in haxe. Because I am new to Haxe and NME. – user1590042 Aug 17 '12 at 10:21
  • I've never done it myself. I think your best bet it's to ask on the nme forums I linked to in my answer. I think you're not understanding just how different Haxe is to Actionscript/Flash: the conversion will be more work than a simple step-by-step... – Jason O'Neil Aug 17 '12 at 23:24