So all the code is now converted to AS3 and the overall performance increase can really be noticed. As i geeked offin the last entry, the ms counter now barely registers 2ms even with over 100 people and 100 buildings! The conversion process took probably just over an hour, however a lot of tinkering was needed for a final version to run smoothly with all the features from the AS2 version.
(Showing 61 buildings, 41 roaming population and no slow down in the engine! The MS counter is actually 2ms it’s just when I grabbed this screen it had dropped to 0)
One of the biggest differences between AS2 and AS3 is just how strict AS3 is. All variables need to be declared and typed correctly. In the long run this is a good thing as it leads to good programming. However users of AS2 who may have become at home with AS2’s lax nature (as I had) will find the change at first frustrating. One of the biggest bits of additional code that the port needed was checks to make sure the function’s weren’t trying to access array’s out of range, something that wont tend to bother AS2 :p
Another change is the way bitmaps work and the introduction of a new object simply called ‘bitmap’. You now need to set up your bitmapData, then create a bitmap from this, and then attach this to your child! OK I’ll admit it’s only one extra line but come on! :D
In finishing up it’s fair to say that I put off opening Flash CS3 for ages, but now I have it could be that I wont go back to coding in AS2. I’ll still be using Flash 8 for drawing, but the performance increase in AS3 is well worth the investment.