ActionScript Guide and Resources

If you want to create applications, interactive website features, and games powered by Adobe Flash Player, ActionScript is the programming language you need to learn. In this guide we introduce ActionScript, explain how to set up a development environment, and provide links to resources you can use to become an ActionScript developer.

If you're new to ActionScript and Flash you will probably do best to read through this article sequentially. If you have a bit more experience and know what you're looking for, feel free to use the table of contents to jump straight to the section you need.

What is ActionScript?

ActionScript (AS) is an object-oriented programming language that works hand-in-hand with Adobe Flash Player to create website animations, online games, desktop applications, and mobile device apps.

Web browsers are designed with native support for HTML, CSS, and JavaScript. However, browsers do not include native support for AS. The ActionScript Virtual Machine (AVM) is needed to run AS code. AVM is an integral component of Adobe Flash Player. Therefore, in order to use AS, the environment where the code will run must be equipped with Adobe Flash Player.

The first version of ActionScript was released in 2000 at the same time as Flash 5 and was used to animate simple 2D vector graphics. With the release of Flash Player 7 in 2003, the capabilities of ActionScript were enhanced and ActionScript 2.0 was born. The most recent version of the language, ActionScript 3.0 (AS3) was released in June of 2006 coinciding with the release of Flash Player 9, the first version of Flash to support AS3.

AS3 is radically more powerful than previous iterations of the language and required a new virtual machine, ActionScript Virtual Machine 2 (AVM2), to run the enhanced code. Flash Player 9 is the earliest version of Flash to include AVM2. As a result, AS3 code can only be run by Flash Player 9 and later.

ActionScript and JavaScript

ActionScript and JavaScript are two different implementations of ECMAScript. What that means is that they both comply with the ECMAScript specification, but include additional features that go beyond the ECMA spec. A useful analogy is to think of ECMAScript as the engine of a vehicle. ActionScript and JavaScript are two different cars that are both powered by the ECMAScript engine.

Because they are both built on ECMAScript, ActionScript and JavaScript look a lot alike and share certain core features. If you already know JavaScript, ActionScript should come to you pretty quickly.

To see how JavaScript and ActionScript have similar syntax let's look at an example of how a function would be written to create a variable holding the string "You kids get off my lawn!"

First, here's how we would create the function in JavaScript:


function LawnResponse() {
var response = "You kids get off my lawn!";
return response;
}

Here's how the same function would appear in ActionScript:


public function LawnResponse() {
var response:TextField = new TextField();
response.text = "You kids get off my lawn!";
addChild(response);
}

As you can see, the syntax is similar and if you already know JavaScript you can read the ActionScript code and understand what's going on.

Set Up an ActionScript Environment

Learning to program JavaScript is simplified by the fact that all browsers support JavaScript natively and mainstream browsers include a JavaScript console to help with development. So it's easy to write code and see what happens by simply loading it in the browser and keeping an eye on the console to find errors and other messages from the browser. Programming ActionScript isn't as straightforward. You need to set up a programming environment that supports ActionScript and can run the code before you export it as an SWF file to be run by the Adobe Flash Player.

There are at least three major implementations of the ActionScript language which you can use to set up a programming environment:

  • Adobe Flash Products: Adobe Animate CC is the modern equivalent of Adobe Flash Professional, and is used to build animations for deployment on the web. Adobe Air is used to package up Flash-powered content as a stand-alone application for installation on Windows, Mac OS, iOS, Android, and other operating systems.
  • Scaleform from Autodesk: a proprietary gaming user interface design tool used to create Flash-powered graphics. Scaleform is used along with Autodesk Stingray, a professional video game development platform.
  • Apache Flex: an open-source framework which can be used to develop applications for iOS, Android, and Blackberry mobile devices, as well as traditional Windows and Mac OS desktop applications.

Of the available options, Adobe Animate is the easiest program to get started with. However, it isn't free. If you want to get started with ActionScript without investing in a proprietary development environment Apache Flex is your best bet.

Learning Resources

Use the resources below to pinpoint the educational content that best fits your current needs and knowledge level.

Apache Flex Guides

If you've decided to work with Apache Flex here are two resources to help you get Flex set up and running:

Guides and Tutorials

With your ActionScript environment set up, you're ready to start learning. In this section we highlight some of the best free online AS3 guides and tutorials.

Learn by Building

ActionScript is perhaps most often used to develop Flash-based browser games. If you want to build simple games, there's no faster way to learn AS3 than to learn as you build simple Flash games:

Reference Documents

If you're stuck looking for a specific function or language feature the official reference documents are the right place to find the information you need.

Books

Most professional developers get to the point that online tutorials no longer provide the depth they need to take their skills to the next level. That's when in-depth technical texts come in handy. The books below are the most popular and useful AS3 texts.

Summary

ActionScript 3.0 is a powerful object-oriented language which can be used to create interactive website features, web-based applications, games, desktop applications, and mobile device apps. If you want to become a Flash developer, adding AS3 proficiency to your qualifications is an important step.