09 Jul 2009 @ 6:38 PM 

So lately i’ve been working on creating a more formal website for myself to highlight my design work and and show potential clients what i can do for them. This site is being built in Flash using FlashDevelop and the Flex SDK. I am not using the Flash IDE from Adobe at all. The entire site is being written in Actionscript 3, including the animations. The site will consist of three main sections: the marketing site which will contain my portfolio and services, the client portal which will be an area where clients can view the status of their project, keep track of how much time is being spent, communicate with the developers (currently only me), upload and view documents and a few other features yet to be determined. The third part will be the admin section where i can manage all of the clients logins, post updates, clock im hours that i have worked and so on.

The site is being powered on the back end by Ruby on Rails using a very basic REST api. So far the client portal is about 50% complete, which has been taking some time because i can including a few different types of charts and graphs that i am writing from scratch in AS3 which is needless to say time consuming.

The more i used AS3 the more i began to realize that although certain things about the language are nice (static/dynamic typing, ability to import SWC libraries), others felt a bit lacking (no generics, enums, anonymous types). I noticed that in FlashDevelop there was this other language called haXe that it supported. Intrigued, i looked it up and quickly read over the language reference and knew that this would be a great language to develop Flash projects in. I was especially glad to see that the bytecode generated by the haXe compiler for the flash vm is often times faster than the code generated by the Adobe compilers. This is especially important for flash game developers who would like to use the nice 3D engines that are available.

One such 3D engine, FFilmation (ffilmation.org) is open-source and looks rather nice at this point. I have been working on the design of an online game based on flash that this engine would work nicely in. The problem is, the engine is written in AS3, and of course i am going to be using haXe for this project. My first thought was to manually translate the AS3 code into haXe, but once i took a closer look at the source code and it’s many files and all the work i would have to do to make the translation i thought there must be a better way. I looked online for an as3tohaxe converter and found only one that seems like it could work. When i ran this converter on the ffilmation directory, it did indeed spit out .hx files, but there was only the most basic of transformations made (basically converting void to Void, int to Int, Number to Float) the basic differences between AS3 and haXe. But the true list of differences is a bit longer:

AS3 supports wildcard import statements, haXe does not. Classes in AS3 can start with lowercase letters, in haXe thet must be uppercase.

Those two restrictions would make it very annoying to have to translate everything manually. So i figured if i wanted this library to be written in haXe, instead of spending all this time doing the translation, that would have to be updated manually every time the original AS3 source was updated, i could spend the time writing a better AS3 to haXe translator that more closely inspects the input files, determines what classes are being used, re-generates the import statements, refactors the class names, converts the data types, converts the ‘for’ loop syntax, and converts the package block into a statement.

After a few days of design and coding i have a working prototype that does everything listed above. I wrote it in haXe and its running on the neko vm so it should be cross-platform and compile on windows, linux and mac osx. I am hosting the code on GitHub so anyone can feel free to fork it and try it out, report any bugs, and ideally patches to make it better. I know its a bit rough right now and i’m sure the code is quite messy, but it will get better.

Right now i am analyzing the output that is being generated to see how things look and see where things need to be improved. My goal is to have the haXe code compile without any modifications needing to be made directly out of the translator.

Look forward to my next few posts which will cover what my analysis results are and what the next steps will be for the project.

Posted By: atmospherian
Last Edit: 09 Jul 2009 @ 06:38 PM

EmailPermalink
Tags
Categories: As3toHaxe, Projects, haXe


 

Responses to this post » (2 Total)

 
  1. 519studio says:

    Hi

    Thanks for the nice information.
    519studio is a best flash website design co. in Delhi.

    Regards

    http://www.519studio.com/

  2. Vivalkakira says:

    Thanks for writing, I very much liked your newest post. I think you should post more frequently, you evidently have natural ability for blogging!

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Change Theme...
  • Users » 4
  • Posts/Pages » 25
  • Comments » 29
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About Me



    No Child Pages.

Projects



    No Child Pages.

Downloads



    No Child Pages.