View Full Version : Upgrading Flash8 AS2 to CS3/AS3?
FizixMan
April 26th, 2007, 11:41 AM
Just curious if anyone has tried converting their Flash 8 (or lower) files & Actionscript 2 up to the new CS3 & AS3. At work we're about 2/3'rds the way through developing an application. At about 37,500 lines of AS2 code now. Probably be at least 55,000 by the time we're done. I'm wondering how compatible the two languages are.
Also, do you know if there's any efficiency & performance boosts in AS3 Flash 9 players over Flash 8 AS2? i.e. in general, would:
for (var i:Number = 0; i < 100000; i++)
{
}
execute faster in Flash 9 AS3 as opposed to Flash 8 AS2?
senocular
April 26th, 2007, 11:50 AM
One of the major advantages of AS3 is speed.
http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html
Compatibility is a tough one. Simple syntax for loops, conditions, and variable usage is pretty much the same (though not entirely) but working with movie clips and events has completely changed. One thing is sure, you can't just change the settings in Flash from AS2 to AS3 and expect your code to work. You will have to do a lot of rewriting.
Check out the AS3 tips of day thread and the migration guide linked at the bottom of the first post for an idea of how things have changed.
broneah
April 26th, 2007, 01:10 PM
How about seemless integration of content between design and development mediums? Check out asset importing...i dont know about you but im sick of talking to my creative directors. Now they just send me psd's :)
Dark Viper
April 26th, 2007, 01:51 PM
Speed is a definite advantage. E.g this script
var n:Number = 0
function testSpeed():Number {
for (;;) {
if (getTimer() > 2000) {
return n
} else {
n++
}
}
}
trace(testSpeed())when run in Flash 8 the average result was 1020000 iterations.
with Flash 9 the average result was 4950000 iterations.
Plus, you will definitely have to rewrite a LOT of code to take advantage of these speed increases - most notably data typing and declaring variables outside of loops.
For example, if in my example you were to declare n inside the function inside of outside you will notice that you will get on average less iterations (though that might be because of something else).
FizixMan
April 26th, 2007, 07:38 PM
Nice, thanks for the info. Good to see that the engine got overhauled.
grimdeath
April 26th, 2007, 08:16 PM
One of the major advantages of AS3 is speed.
http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html
Compatibility is a tough one. Simple syntax for loops, conditions, and variable usage is pretty much the same (though not entirely) but working with movie clips and events has completely changed. One thing is sure, you can't just change the settings in Flash from AS2 to AS3 and expect your code to work. You will have to do a lot of rewriting.
Check out the AS3 tips of day thread and the migration guide linked at the bottom of the first post for an idea of how things have changed.
Ya I experienced this firsthand i was trying to do a preloader and to my amazement i couldnt attach any actions to the movieclip I was like WTF, I really hate learning AS with each version of flash its just so frustrating :fight:
dColumbus
April 26th, 2007, 08:50 PM
Whatever man... I'll learn the latest adjustments... CS3 kicks some major ***! I just got it, and it runs faster, looks better, allows for complete Photoshop --- > Flash integration, complete component color skinning from within the application (like flash 5 did), and a lot more. I'm sure there will be thing I wont like to change in my routine, but over all, this version truly makes a complete package. And, in light of Microsoft's strides on the design front, they needed to keep their products way ahead of the game. Good on you Adobe!
FizixMan
April 27th, 2007, 03:09 PM
I finished porting our spatial index classes over to AS3 for a test. My goodness what a performance gain! It was literally 10 times faster on AS3, same script! =]
Looks like once I'm done working on my current branch at work, I'll be spending the next week porting. I'm just glad the port wasn't too bad. A lot of fixing up, but the compiler is pretty good at picking stuff up.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.