Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect?
views:
273answers:
4I don't think you can ever use an automatic converter for this task. A converter may be able to save you some steps or point out places where change must take place, but you'll have to go over the code manually.
For example, referring to a _level0.variableName in AS2 can point to a movieClip on the _root level, to a FlashVar sent from the HTML container or to an object created by the code itself. There's no real way of knowing. (You can't look for the varname in the code since that too can be calculated or read externally.
You need to have a very good reason to do such conversion. If AS2 is not suitable anymore for some reason, maybe you should try to solve the problem instead of converting to AS3 just because it has a nice little function that you need.
I asked a similar question a little while ago that you might find useful:
What is the best approach to moving a preexisting project from Flash 7/AS2 to Flex/AS3?
Some minor tasks might be automatable (fixing package declarations mainly), but other than that I doubt it could be automated.
Thanks for the answers, my thoughts are simular. @Herms: your post is very usefull.
I've always had a bad time of things when converting from AS2 to AS3, mostly because there is not good automated scripting for the whole process and quite frankly it's boring. In the long run updating old AS2 code on projects that are still active and being updated themselves is a great idea, AS3 is just a better language and AVM2 is just straight up faster than AVM1.
You could use a script to take out the underscores in a lot of properties, add the package info, do some of the base imports, but what I've found is probably the best way for me is to just dump your main or manager class into the document class line in your FLA, comment everything but the constructor out and just start converting and un-commenting as you go. It might seem slow but I feel like trying to figure out 40 different compiler errors at once might end up being slower.
Good luck, it's necessary work, but not fun work.