ActionScript changes in AS3

Ready to get into ActionScript 3 coding? Or maybe you just want to see what’s in store for coding for the Flash 9 player? Check out this nice table of differences between ActionScript 2 and ActionScript 3.

You'll be surprised to see how much has been removed, like:
duplicateMovieClip()
removeMovieClip()
attachMovie()
_lockroot
toString()
_level
newline
sendAndLoad()
the entire Selection class
and more...
Don't worry though most of the things that have been removed still exist from a functional standpoint, they have just been moved to other classes/packages.

So far I am really excited to get my feet wet with these changes. I'll be honest though when I first heard it was changing so drastically I wasn't so excited. However it looks like Adobe (still sounds weird to say that) has done a great job in this new version. It definitely seems more logical...and more robust.

8 Responses to “ActionScript changes in AS3”

  1. senocular Says:

    toString hasn’t gone anywhere

  2. Crucial Says:

    Sorry, I should have been more clear… toString() as part of the LoadVars class (which I guess is now flash.net.URLLoader) is gone… I should have looked closer I guess… might not have come across as dramatic then ;)

  3. Olga Says:

    and what about _lockroot?

  4. Crucial Says:

    _lockroot is no more. root (notice the underscore is no longer present) now references the root of the swf file it was created on (which is what _lockroot provided). So now AS3 works with _lockroot being the default. It’s no longer that horrible to reference root anymore (thats going to take some getting used to for many ActionScript purists) :D

  5. Niraj Says:

    attachmovie() is removed so how to handle in AS3?

  6. Crucial Says:

    @Niraj – instead of attachMovie() you would now use addChild. When you set your item up in your library to export for actionscript you wil notice that the “Linkage Name” field is now replaced with a “class” field. For example if I draw a box on the stage and convert it to a MovieClip and give it a name of testClip, then check the “Export for ActionScript” box, I would see the following dialog box .

    When you click ok you will get a dialog box giving you a warning that it could not find a class named testClip so it will create one for you. The dialog box will look like:

    Then to add the item to the stage you would refrence the class name given to your clip in the library. So in this example code would look like this:
    var clip : testClip = new testClip();
    addChild(clip);

    Hope that helps,
    -Dave

  7. Netto Says:

    Well, Is it possible to load an AS 3.0 swf in an AS 2.0 file?

  8. Crucial Says:

    @netto unfortunately you cannot load an AS3 SWF into an AS2 SWF. The separate AVM’s just dont work that way. The SWF files get loaded into one AVM or the other and cant communicate. You can load an AS2 file into and AS3 file however you’ll need to use LocalConnection to communicate between the files.

    For Actionscript/AVM compatibility check out this chart on LiveDocs http://bit.ly/iCsw . Hope that helps,
    -Dave

Leave a Reply


Visit Portfolio :

Crucial Limit

Client List :

Aces Tattoos | 82 Tattoo | Eric Peacock | Kustom Tattooz | Laser Imaging & Design | Laterras R. Whitfield | Solipsum | Travelocity ExperienceFinder {beta} | Travelocity | ZSI

Socialize:

Flickr | View Dave Gillem's LinkedIn profileView my LinkedIn profile | Twitter | Facebook | Become a fan of Crucial Limit on Facebook Become a fan on Facebook

Add to:

Videos, Slideshows and Podcasts by Cincopa Wordpress Plugin