
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
340
|
Chapter 14: Distributing Class Libraries
Creating a No-Source Compile-time Class Library
A compile-time class library (a.k.a. a static class library) takes the form of a Flash MX
2004 component, which includes the following:
• The compiled bytecode for the classes in the library
•Anintrinsic class definition file for each class in the library (this provides type
checking information to the compiler)
• An optional icon .png file for use in the Flash MX 2004 Components panel
In Flash MX 2004, components are fundamentally visual entities. They are sub-
classes of the MovieClip class and intended primarily as reusable GUI widgets. The
type of class library we want to build, by contrast, is not visual at all. It is simply a
collection of code that can be added to an application. Hence, shipping a nonvisual
class library as a component is, in part, an exercise of fitting a square peg into a
round hole. That is, some aspects of the component-creation process are obviously
not related to the basic task of shipping class libraries. However, these aspects are
required due to the architecture of components in Flash MX 2004. What matters in
the end is that it all works.
To learn how to create a compile-time class library as a component, we’ll return to
our fictitious web shop, Spider Services. ...