CSM ActionScript Class Lecture 20 January 10 from Cody Tolmasoff on Vimeo.

Screencast of lecture from College of San Mateo ActionScript class from 20 January 2010

Note: no assignment

Example Sites mentioned in class:

Lecture:

  • Overview – What is ActionScript
  • The Flash Platform
  • Procedural vs Object Oriented Programming
  • The Document Class
  • Legacy Code Compatibility

What is ActionScript
Different versions of ActionScript (.5, 1, 2, 3)
What’s different about ActionScript 3
Benefits of ActionScript 3 (compared with previous versions)

  • More Detailed Error Reporting
  • Syntax Improvements
  • New Display Architecture
  • New Event Architecture
  • Vastly Improved XML haldeling
  • More text scripting options
  • New Regular Expressions
  • More Sound management options
  • New Access to raw data
  • New automatic scope management
  • Improved Object Oriented Programming OOP

The flash Platform
http://www.adobe.com/devnet/actionscript/articles/atp_ria_guide/atp_ria_guide.pdf
Adobe Flash (CS3/CS4) IDE (Integrated Developer Environment)
Adobe Flex
Adobe Air
Flash Streaming Server
3rd party libraries
Papervision 3d
SWF Object

Procedural vs Object Oriented Programming (OOP)

The Document Class
We will be using the document class quite a bit in our class this semester, so its important that we understand how to set it up.
Open Flash and create a new ActionScript 3 flash file, and do file > new again and create a new ActionScript file. Save both files to the same directory, however the ActionScript file needs to be named “Main.as”. (Both files should be accessible in tabs in the Flash IDE).
Navigate to your Flash file and locate the properties panel. In the properties panel locate a field labeled “Class:”. Type Main here. (If you are not seeing this, make sure you have nothing on the stage selected.)
Navigate to your ActionScript file called Main.as. We need to write the following:

package {
    import flash.display.MovieClip;
    public class Main extends MovieClip {
        public function Main(){
            trace("woo whoo");
        }
    }
}

Save your files and publish your Flash file (navigate back to your flash file and hit cmd + enter). If all has gone well you should see an output window open up and show the words woo whoo in the box.

Legacy Code Compatibility
Flash projects built in ActionScript 3 do not work well with Flash projects built in ActionScript 2 and below. AS3 projects can load AS2 projects, however communication between the two is incredibly difficult, and you really want to avoid it if at all possible. (Note: if you are ever faced with this, look up External Interface). AS2 projects cannot load AS3 projects at all.