Macromedia flash mx 2004-learning flash 用户手册
113
CHAPTER 15
Work with Objects and Classes Using
ActionScript 2.0
Classes are the blueprint for objects in Macromedia Flash MX 2004 and Macromedia Flash MX
Professional 2004. All objects in Flash have an underlying class; for example, all movie clips have
a method called
Professional 2004. All objects in Flash have an underlying class; for example, all movie clips have
a method called
getURL
, and
getURL
is defined in the class definition for a movie clip. Flash
contains many predefined classes, such as the MovieClip class, the Array class, the Color class,
and the CheckBox class.
and the CheckBox class.
In this lesson, you’ll learn about creating and modifying classes. Specifically, you’ll learn how to
accomplish the following tasks:
accomplish the following tasks:
•
Create objects from existing classes
•
Create a custom class
•
Use datatyping with custom classes
•
Extend an existing class
Note: This lesson is designed for Flash developers who are familiar with basic Flash and
ActionScript concepts.
ActionScript concepts.
Set up your workspace
First, you’ll view the finished files and set up your workspace to use an optimal layout for
taking lessons.
taking lessons.
1.
View the finished files. This lesson does not include start files. You can find finished files of
handson1.fla, handson2.fla, handson3.fla, Product.as, and Drag.as, which are examples of the
files that you’ll create in this lesson:
handson1.fla, handson2.fla, handson3.fla, Product.as, and Drag.as, which are examples of the
files that you’ll create in this lesson:
■
On Windows 2000 or XP, browse to boot drive\Documents and Settings\All
Users\Application Data\Macromedia\Flash MX 2004\language\Configuration\HelpPanel\
HowDoI\BasicActionScript\finished_files.
Users\Application Data\Macromedia\Flash MX 2004\language\Configuration\HelpPanel\
HowDoI\BasicActionScript\finished_files.
Note: If the Application Data folder is hidden, you’ll need to change your Windows Explorer
settings to see the folder.
settings to see the folder.
■
On Windows 98, browse to boot drive\Windows\Application Data\Macromedia\Flash MX
2004\language\Configuration\HelpPanel\HowDoI\BasicActionScript\finished_files.
2004\language\Configuration\HelpPanel\HowDoI\BasicActionScript\finished_files.