Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 27

Programming actionscript 3.0
Table of Contents

Advertisement

Designing your ActionScript application
You should have some idea about the application you want to build before you start building it.
The representation of your design can be as simple as the name of the application and a brief
statement of its purpose, or as complicated as a set of requirements documents containing
numerous Unified Modeling Language (UML) diagrams. This book doesn't discuss the
discipline of software design in detail, but it's important to keep in mind that application
design is an essential step in the development of ActionScript applications.
Our first example of an ActionScript application will be a standard "Hello World"
application, so its design is very simple:
The application will be called HelloWorld.
It will display a single text field containing the words "Hello World!"
In order to be easily reused, it will use a single object-oriented class, named Greeter, which
can be used from within a Flash document or a Flex application.
After you create a basic version of the application, you will add new functionality to have
the user enter a user name and have the application check the name against a list of known
users.
With that concise definition in place, you can start building the application itself.
Creating the HelloWorld project and the Greeter class
The design statement for the Hello World application said that its code should be easy to
reuse. With this goal in mind, the application uses a single object-oriented class, named
Greeter, which is used from within an application that you create in Flex Builder or the Flash
authoring tool.
To create the HelloWorld project and Greeter class in Flex Builder:
1.
In Flex Builder, select File > New> Flex Project,
2.
If the New Flex Project dialog box asks you to select a Flex Server Technology, select Basic,
and then click Next.
3.
Type HelloWorld as the Project Name, and then click Finish.
Your new project will be created and should be showing in the Navigator panel. By default
the project should already contain a file named HelloWorld.mxml, and that file should be
open in the Editor panel.
4.
Now to create a custom ActionScript class file in the Flex Builder tool, select File > New >
ActionScript File.
Example: Creating a basic application
27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents