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.

Advertisements

~ by brianchau on July 17, 2007.

8 Responses to “Migrating from AS2 to AS3”

  1. If you practice a while AS3 makes your hapier!

    Good luck with the practice!

    Kind regards!

  2. 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.

  3. 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

  4. 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.

  5. doesn’t replace it at all. It was very easy to modify the “z axis” dynamically of a movie clip.

  6. it’s still easy, just use the new methods

  7. whats great about as3 is that everyone not practicing oop using classes and packages is left in the dust.

  8. nice said!
    indeed – AS 3 makes more sense and organize the logics.
    cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: