
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
294
|
Chapter 12: Using Components with ActionScript 2.0
With our component-loading keyframe prepared, we can now place a dummy
instance of each component on our document’s timeline, as follows:
1. Select frame 12 in the load components layer.
2. From the Library, drag an instance of each component to the Stage.
3. Optionally use the Component Inspector panel (Window
➝ Development Pan-
els
➝ Component Inspector) to add dummy text to each component instance
indicating that it is not used, as shown in Figure 12-2. Consult Flash’s online
help for instructions on setting component parameters via the Component
Inspector.
Figure 12-2 shows how our document’s timeline and Stage look with frame 12 of the
load components layer selected.
Starting the Application
In Chapter 11, we saw how to start an OOP application by invoking the main( )
method of the application’s primary class (i.e., the class and method that we design
to be the program launch point). We’ll start our currency converter by invoking
main( ) on our application’s primary (indeed, only) class, CurrencyConverter. The
main( ) call comes on frame 15 of the scripts layer in CurrencyConverter.fla’s time-
line, after our classes and components have been preloaded. Here’s the code:
import org.moock.tools.CurrencyConverter;
CurrencyConverter.main(this, ...