Migrating from AS2 to AS3
I have been gradually rewriting some of my previous demos files from AS2 to AS3. What I’ve found is almost all the scripts needed to be rewritten as they were not compatible with AS3. Well no pain, no gain. So I soldier on. In the process it is a great learning experience. So if you are hesitating to learn AS3, I encourage you to give it a try.
Today I tried to set the depth (z-0rder) of an object. With AS2 I would be using something like swapDepth(). With AS3, it is setChildIndex(). I think it makes more sense. Don’t you think.
If you practice a while AS3 makes your hapier!
Good luck with the practice!
Kind regards!
jankees said this on July 17, 2007 at 9:17 pm |
word the struggle from AS2 to AS3 has been a tough one, but if you learn it now, you’ll be part of the first wave, helping next years newbs. when it comes to AS3 everyone is basically a newb so don’t hesitate to ask questions, i know i don’t.
tafaridh said this on July 31, 2007 at 1:27 pm |
I suppose the setDepth() method is sorta AS2 ‘ish, but they dont replace getNextHighestDepth() with anything, thats just backwards.
I know you can get around it, but the code is now much longer to do that simple task. And its easy to have built it right in.
Cant wait for AS4…sure hope its forward thinking , like Ruby or Python
Bradley said this on August 24, 2007 at 3:09 pm |
There is no need for getNextHighestDepth because addChild automatically adds the object at the next highest index now.
And you can always use numChildren to achieve the same functionality as getNextHighestDepth if you need to get the highest index for some reason.
Jared said this on October 20, 2007 at 7:47 pm |
doesn’t replace it at all. It was very easy to modify the “z axis” dynamically of a movie clip.
Edgard said this on October 30, 2007 at 8:09 pm |
it’s still easy, just use the new methods
gast22 said this on December 10, 2007 at 2:10 pm |
whats great about as3 is that everyone not practicing oop using classes and packages is left in the dust.
dave said this on January 15, 2008 at 5:03 pm |
nice said!
indeed – AS 3 makes more sense and organize the logics.
cheers.
oren said this on January 28, 2008 at 8:05 am |