Chapter 2: Getting Started With Actionscript; Options For Organizing Your Code - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

3.
Create a Flash or Flex application file to run your code.
In the Flash authoring tool, this involves creating a new FLA file, setting up the publish
settings, adding user interface components to the application, and referencing the
ActionScript code. In the Flex development environment, creating a new application file
involves defining the application and adding user interface components using MXML,
and referencing the ActionScript code.
4.
Publish and test your ActionScript application.
This involves running your application from within the Flash authoring or Flex
development environment, and making sure it does everything you intended.
Note that you don't necessarily have to follow these steps in order, or completely finish one
step before working on another. For example, you might design one screen of your application
(step 1), then create the graphics, buttons, and so forth (step 3), before writing ActionScript
code (step 2) and testing (step 4). Or you might design part of it, then add one button or
interface element at a time, writing ActionScript for each one and testing it as it's built. So
while it's convenient to remember these four stages of the development process, in real-world
development it's usually more effective to move back and forth among the stages as
appropriate.

Options for organizing your code

You can use ActionScript 3.0 code to power everything from simple graphics animations to
complex, client-server transaction processing systems. Depending on the type of application
you're building, you may prefer to use one or more of these different ways of including
ActionScript in your project.
Storing code in frames in a Flash timeline
In the Flash authoring environment, you can add ActionScript code to any frame in a
timeline. This code will be executed while the movie is playing back, when the playhead
enters that frame.
Placing ActionScript code in frames provides a simple way to add behaviors to applications
built in the Flash authoring tool. You can add code to any frame in the main timeline or to
any frame in the timeline of any MovieClip symbol. However, this flexibility comes with a
cost. When you build larger applications, it becomes easy to lose track of which frames
contain which scripts, which can make the application more difficult to maintain over time.
24
Getting Started with ActionScript

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents