Under the hood
In early versions of Flash, developers were limited to timeline animation when it came to adding interactivity
to their applications. In more recent releases, increased scripting support has been incorporated
using a language called ActionScript.
syntax, making it easy for developers to alternate between the two.
Within Flash, ActionScript is designed to be asynchronous, allowing multiple lines of code to be executed
concurrently and using callbacks in order to pass data. A developer can define custom events
and assign them to be dispatched during code execution, and listeners are assigned to monitor the
application for events and to execute the appropriate code block.
You can create ActionScript using a simple text editor; however, the Flash integrated development
environment (IDE) offers additional functionality such as syntax highlighting, code autocompletion,
compiler integration, and a language reference. In addition, third-party IDEs such as FDT, FlashDevelop
(see Figure 2-4), and SEPY offer ActionScript-specific support and functionality beyond what’s found in
the Flash IDE.
With the release of Flash Player 9, ActionScript made the jump from version 2.0 to version 3.0. This
represented a major overhaul of the language’s syntax and structure. In addition, ActionScript 3.0 uses
a new compiler that transforms your ActionScript code into byte code and a new virtual machine in
which the byte code is executed.
ActionScript 3.0 can offer developers a massive performance boost, offering performance approximately
ten times faster than the equivalent ActionScript 2.0 code. In addition, it offers support for
runtime exceptions, type checking, data types, and regular expressions—all functionality that aids
developers when creating rich Internet applications and mashups that rely heavily on client-side data
processing and visualizations.
There is also a vastly enhanced XML parsing engine, E4X, which reduces the complexity and lines of
code required to manipulate XML documents.