This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Understanding the Framework
|
593
Understanding the Framework
The component framework comprises nearly 600 lines of code (not counting the
components’ code), which was never documented. It’s no wonder some developers
decided to shy away from it and develop their own framework!
As we’ve seen throughout the chapter, to load one or more external .asc files, use the
load( ) command in your application, such as main.asc:
load("components.asc");
An .asc file can load other .asc files. For example, loading components.asc is really
just a shortcut to loading framework.asc and many other components cited within it.
You can load the framework and only those components you want (such as the
Chat), as follows:
load("framework.asc");
load("components/chat.asc");
The Frameworks Files
Let’s look at the files that make up the server-side framework. For a detailed descrip-
tion of each file, refer to “The Framework’s Code,” later in this chapter. Here’s a
brief description of all the files that make up the server-side framework:
components.asc
A very simple file that loads the framework.asc and every communication com-
ponent that ships with FlashCom. You can add a load( ) statement to automati-
cally load your own custom components as well. Loading components.asc is easy
but is overkill if you need only one or two components.
framework.asc
This constitutes the framework itself and is where the global
gFrameworkFC sin-
gleton—one of two main pillars of the component framework—is defined. The
gFrameworkFC stores references to each component’s instances, along with the
components’
clientGlobals memory space, as discussed later. This file automati-
cally loads application.asc and facade.asc as well.
application.asc
This file is necessary for the framework. This is where the framework hijacks the
application object to enhance it with some framework-specific functionality.
};
_fEventDispatcher = new EventDispatcher( );
Example 14-9. Server-side port of the EventDispatcher class (continued)

Get Programming Flash Communication Server now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.