
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
298
|
Chapter 12: Using Components with ActionScript 2.0
Importing the Components’ Package
Our CurrencyConverter class makes many references to various component classes
(Button, ComboBox, Label, etc.). The component classes we need reside in the pack-
age mx.controls. Throughout our CurrencyConverter class, we could refer to the com-
ponents by their fully qualified names, such as mx.controls.Button or mx.controls.
ComboBox. That obviously gets tedious, so prior to defining our CurrencyConverter
class, we import the entire mx.controls package, as follows:
import mx.controls.*;
Once the mx.controls package is imported, we can refer to a component class such as
Button without specifying its full package name. Note that not all component classes
reside in the mx.controls package. For example, the classes for containers such as
Window and ScrollPane reside in the mx.containers package. To determine the pack-
age for a component class, consult its entry in Flash’s built-in Components Dictio-
nary (Help
➝ Using Components ➝ Components Dictionary).
For complete details on packages and the import statement, see Chapter 9.
CurrencyConverter Properties
Our CurrencyConverter class defines two general categories of properties: class prop-
erties that specify the exchange rates for various currencies ...