Logo link to Tomontheweb.ca
Flash Server

The Basics of ActionScript


ActionScript 2.0 is an Object Oriented Programming language - the hard-core coders refer to it as OOP- based upon the ECMA-262 scripting standards, (The same standards that the JavaScript language is based on) used to add interactivity to web pages. The major advantage to you is that OOP is designed let you reuse code when building Flash applications. OOP is a monstrous subject and trying to fully explain it would be well beyond the scope of this book. The subject is covered in quite some depth Derek Franklin’s Flash MX 2004 ActionScript:training from the source and Jeanette Stallons’ Flash MX 2004 Application development: training from the source.

If you are familiar with Flash in its MX and MX 2004 forms you have encountered ActionScript and if you moved from the MX version to the MX 2004 version you encountered ActionScript 2.0. Though you can use ActionScript 1.0 in Flash 8 Professional, most of the industry has adopted the use of ActionScript 2.0. In fact, Lesson 12- Going Mobile with Flash - relies solely upon ActionScript 1 due to the nature of the Flash Player for cell phones.

The major difference between the two versions is how the code is formatted. Strict data typing, which we get into later in this lesson, is only supported by ActionScript 2 ( sometimes referred to as AS2) . Another major difference is the way events are generated and managed by Flash. An event would be something that is initiated by a button click, press of a key or the end of a video.

Another aspect of AS2 is the ability to write code to external files that use the .as extension from within Flash. These files could contain custom methods and properties related to a single object such as a movie clip or a custom object. These files are referred to as classes and classes are widely used throughout Flash 8 Professional. Creating your own classes is well beyond the scope of this book but classes are discussed later on in this lesson.

Finally, when you create a SWF, be sure to indicate in the publishing options which version of ActionScript you are using. You need to do this in order to have the SWF compile properly.

Compile? It is a fancy word for publish. When you publish a SWF, it is said to be “compiling”.

... NEXT

photo Tom Green
Tom Green

Who is tom green?

Teacher, author, raconteur. Here's a run down of what I have been up to over the past few years. My Bio.

Classes

Class Project 1