This is a teaser for my upcoming talk at 360|Flex San Jose. I will be talking about how to improve your programming by reading the Flex source code. You should come to the conference (even if you aren't interested in my talk). There are lots of other great speakers.
Choosing a base class for your Flex component involves understanding the base classes that Flash provides. The primary classes in Flash that you should recognize are Sprite, Shape, and TextField. These classes are by far the most common in Flex code and you need to know what capabilities and limitations they have.
Sprite is a powerful, all-around handy class. Sprite is designed to support all of the basic operations that you need when building a UI. You can draw custom graphics into it using the Flash drawing API, you can add child components to it, and it responds to user interaction. Each of these capabilities comes from a different parent class. Its inheritance path is Sprite < DisplayObjectContainer < InteractiveObject < DisplayObject. DisplayObject is the parent of all visible objects in Flash that can appear on the Stage. InteractiveObject adds support for keyboard and mouse interaction; DisplayObjectContainer adds support for child DisplayObjects, and the drawing API is added in Sprite. The most important Flex class that subclasses Sprite is UIComponent, and all "top-level" Flex components subclass it.
As powerful as Sprite is, it does not have support for rendering text directly. This is the domain of the TextField class. TextField has a short hierarchy: TextField < InteractiveObject < DisplayObject; therefore it supports rendering and interactivity. The TextField class itself adds support for the display and styling of text.
For a Sprite to have text, you must create an instance of TextField and add it as a child to the Sprite. Similarly, if you want to combine graphics with a TextField you will need a Sprite for drawing them or for parenting other assets such as an image. TextFields are used in Flex primarily through the UITextField class which used by Label, TextArea, Button and others to render text in Flex.
The Shape class is a minimal class that supports the same drawing API as Sprite but omits interactivity and child functionality. Shape inherits directly from DisplayObject. The Shape class carries less of a memory and performance burden for your system since it has no children and ignores interactivity. This means that the Shape class is ideal when you just need to draw a pretty picture. In Flex, the ProgrammaticSkin class is a child of Shape. This allows the skin have less overhead but also limits its functionality.
There are many other Flash classes, but these three are really the core of the player and are used extensively in Flex. It is tempting to assume that your components always extend UIComponent and therefore have the flexibility of a Sprite, however sometimes this is not the case. Confusion often arises from the DataGridItemRenderer and the AdvancedDataGridItemRenderer, which both subclass TextField and therefore do not support child components or the drawing API. The other common confusion is that ProgrammaticSkin extends Shape and therefore does not support user interaction or children. In both of these cases, you can create your own substitute class which extends UIComponent, if you need the functionality and are willing to accept the additional performance cost.