Accessibility

Flash Article

 

Exploring the version 2 component architecture in Flash 8


Table of Contents

Using Managers and Mix-ins

The v2 component architecture features a set of managers (system-level static classes) and mix-ins (classes that decorate other classes with methods useful for a specific task). These classes help component and application developers by providing common, reusable pieces of functionality.

Following is a selection of managers and mix-ins included in the v2 architecture.

DepthManager (mx.managers.DepthManager)
The DepthManager class adds functionality to the ActionScript MovieClip class, which allows you to manage the relative depth assignments of any component or movie clip, including _root. It also allows you to manage reserved depths in a special highest-depth clip on the _root for system-level services like the cursor or tooltips.

FocusManager (mx.managers.FocusManager)
The FocusManager class keeps track of the currently focused item and how focus changes based on various user input events: keystrokes, Enter, Tab, or mouse-click. All components implement FocusManager support; you don't need to write code to invoke it. FocusManager also interacts with SystemManager, which activates and deactivates FocusManager instances as pop-up windows are activated or deactivated. Because each modal window has an instance of FocusManager, the components in that window become their own tab set, preventing users from tabbing into components in other windows.

PopUpManager (mx.managers.PopUpManager)
The PopUpManager class allows you to create overlapping windows that are modal or nonmodal. (A modal window doesn't allow interaction with other windows while it's active.) You can call PopUpManager.createPopUp() to create an overlapping window and call PopUpManager.deletePopUp() on the window instance to destroy a pop-up window.

StyleManager (mx.styles.StyleManager)
The StyleManager class keeps track of known styles and colors that you can apply to a given component as properties of that component. Use this class when you want to add a new inheriting style or color to a component you've created. The style properties (font styles, border colors, and many more) that are built in to StyleManager are based on a subset of the Cascading Style Sheets specification of the W3C. To determine which styles are supported in particular, investigate the StyleManager source code.

EventDispatcher and UIEventDispatcher (mx.events.EventDispatcher, mx.Events.UIEventDispatcher)
The EventDispatcher classes are mix-ins: They are meant to be mixed in with another class to give classes event-dispatching abilities. Similar to the native ASBroadcaster method, these event dispatchers feature an initialize() method, which takes as a parameter an object instance to which you attach methods that are specific to generating events and managing listener lists.

Find more information on the set of managers and mix-ins in Using Components in Flash Help.