Accessibility

Flash Article

 

Flash ActionScript 2.0 Learning Guide


Flash

Macromedia

Instructional Media Development (IMD)
Macromedia Documentation

Jen deHaan

Editor: Jen deHaan

Flash Authoring QE
Adobe
Jen deHaan's blog
flashthusiast.com
webvideoblogger.com

Table of Contents

Created:
12 September 2005
User Level:
Beginner

Note: This learning guide introduces ActionScript in Flash and provides you with tools for developing your skills. The Flash product documentation is the source of many of these materials; always consult Flash Help or LiveDocs first when learning to use new features.

ActionScript is the scripting language used by Macromedia Flash. It makes your Flash content interactive. ActionScript provides a more efficient way to do things in Flash, from creating simple animations through designing complex, data-rich, interactive application interfaces. As the scripting language for Macromedia Flash, ActionScript has evolved incrementally over many releases. There are two versions of ActionScript: ActionScript 1.0 and ActionScript 2.0.

ActionScript 1.0, the less formal version of ActionScript, is fine for most general purposes and when you want to target an old version of Flash Player. Want to generate some simple interactivity when a user clicks a button? Want to create an application for a mobile device? Go with ActionScript 1.0. But for creating more complex code, ActionScript 2.0 is more appropriate.

ActionScript 2.0 is an object-oriented programming language that supports full class inheritance and all the features that developers demand from a mature language. It gives you a more flexible programming environment and superior debugging abilities. At the heart of ActionScript 2.0 is a formal and familiar approach to object-oriented programming (OOP), including full support for classes, inheritance, interfaces, and other common OOP concepts. ActionScript 2.0 also includes features that enhance ActionScript programming, such as variable data typing, function parameters and return types, and comprehensive debugging information. ActionScript 2.0 benefits developers by encouraging better programming structures and reducing coding and maintenance time. Want to write code using a formal programming language with more robust capabilities? Go with ActionScript 2.0.

To find out whether ActionScript 2.0 is right for your project or whether ActionScript 1.0 is the simpler, faster solution, check out the following resources, so you can make the call and be as efficient as possible for every project.

  • If you are new to ActionScript, read first about the syntax and fundamentals of the language in LiveDocs. Select Learning ActionScript 2.0 in Flash and read two sections: Data and Data Types and Syntax and Language Fundamentals.
  • To understand the differences between ActionScript 1.0 and 2.0, start with Choosing between ActionScript 1.0 and 2.0 and Migrating to ActionScript 2.0.
  • To compare advantage object-oriented coding in ActionScript 1.0 and 2.0, read the following:

    • For ActionScript 1.0, read Object-Oriented Programming with ActionScript 1.0 in the Learning ActionScript 2.0 section of LiveDocs.
    • For ActionScript 2.0, read Object-Oriented Programming section below and the Classes section of Learning ActionScript 2.0 in LiveDocs.

This guide introduces you to some of the fundamental concepts of ActionScript 2.0 and object-oriented programming. The following sections define common terminology, show you how to structure Flash applications, show you how to approach learning the ActionScript language and scripting in Flash, and where to go to find more information and examples.

Note: ActionScript coding conventions are very important for Flash designers and developers to ensure that code and applications are structured in a way that is intuitive and beneficial to themselves as well as other people working on the same project. For more information, see ActionScript 2.0 Best Practices.

If you're new to the ActionScript language, again, see the Syntax and Language Fundamentals section of the Learning ActionScript 2.0 manual in Flash LiveDocs for an introduction to ActionScript. If you're familiar with ActionScript and want to get started creating classes with ActionScript 2.0, see the “Writing Custom Classes” example in the Classes section of same manual.

Note: This learning guide if for Flash 8 users. Please see the previous version of the Flash ActionScript Learning Guide if you are using Flash MX 2004.

Requirements

To follow along with this learning guide, you will need to install the following software and files:

Macromedia Flash Basic 8

or Macromedia Flash Professional 8

Prerequisite Knowledge

A basic familiarity of Flash and a basic knowledge of the Flash workspace are required. Check out the Getting Started Learning Guide if you are using Flash for the first time.

About the authors

Macromedia Instructional Media Development (IMD) is a team of instructional designers, developers, technical writers, technical editors, publishing engineers, and multimedia artists. IMD authors the online help systems, manuals, tutorials, and examples that help customers learn how to use Macromedia products.
Jen deHaan, a rather awkward and uncool Canadian, likes robots and pirates (as well as robotic pirates). Jen works on documentation at Macromedia in San Francisco. She also maintains a blog at weblogs.macromedia.com/dehaan and believes that _root and low-carb diets are unusually evil.