Posted on Monday 13 November 2006
I’ve started to work a bit in AS3 and I will have to eventually convert an AS2 to project to AS3, which, considering it has over 100 classes already done, is going to be a major pain. So I thought of making a quick preprocessor converter that would take care of the most obvious and repetitive parts of converting from AS2 to AS3 so I can thereafter concentrate on the subtler points. I want your opinions on what it would need to do to make it actually useful for you guys. Here is my current (tentative) feature list:
- Detect package and wrap, add necessary tabs
- Add imports for things like MovieClip, TextField, etc.
- Change .beginFill to .graphics.beginFill, etc.
- Change ._x to .x etc.
- Change createEmptyMovieClip to new MovieClip, addChildAt
- Change createTextField to new TextField, addChildAt
- Add Mouse/EnterFrame/etc. listeners for things that extend movieclip when that function is overriden (ie, if there is an onEnterFrame function in the class, add a listener to enterframe in the constructor)
- Change private to protected
- Strip Delegates
That’s off the top of my head, anything else?


