Page 1 of 2 The Flex 2 framework provides a large assortment of components to handle the majority of your UI (user interface) needs. Taking advantage of these components is the quickest way to build a fully functional application, however, there are many times where you might find yourself in need of a component that does not exist. Fortunately, the Flex SDK offers plenty of extensibility for building custom UI components that can plug seamlessly into the existing framework.
The UIComponent class is the least common denominator of all visual Flex components. That is to say, any class that is treated as a display object should have (at the very least) UIComponent in its inheritance chain. Flex has a very specific process for populating and maintaining the display list, and this class will provide most of the template behaviors it needs from your custom display objects. It's important to note that many operations within the framework happen asynchronously to allow your applications to run as smoothly as possible, and therefore it's up to you to adhere to the conventions for building your components, preserving the harmony of the system's processes.
The UIComponent class is an indirect subclass of Sprite, which means that if you wish to use a different display object type, such as MovieClip or Bitmap, you will have to create such objects from within a custom UIComponent via composition (a UIComponent that has a Movieclip or Bitmap as opposed to a UIComponent that is a MovieClip or Bitmap).
There are two main procedures that need to be considered when building UIComponents: initialization and validation. During the creation cycle, both procedures (and a couple of additional steps) are processed. However, the validation procedure is additionally reused any time a visual change is triggered that may affect the system, whether externally to the component, or internally by the component. Figure 1 below demonstrates the creation cycle of a component.

Figure 1: The creation cycle of a UIComponent. The green region indicates the initialization procedure of the cycle, while the blue region indicates the validation procedure. The gold-colored steps identify methods that are provided for developers to override and implement custom behavior for, and the maroon-colored steps indicate dispatched events. The objects are ordered chronologically, where the thread processes from left to right as it works its way down each phase.
Keywords
UIComponent, custom components, Flex 2, initialize, creation