Macromedia flex 2 Manuale

Pagina di 254
About creating components
15
This example shows the following relationships among the components:
You define a main MXML file that contains the 
<mx:Application>
 tag. 
In your main MXML file, you define an ActionScript block that uses the 
<mx:Script>
 
tag. Inside the ActionScript block, you write ActionScript code, or include external logic 
defined by an ActionScript file. Typically, you use this area to write small amounts of 
ActionScript code. If you must write large amounts of ActionScript code, you should 
include an external file.
The main MXML file uses MXML and ActionScript to reference components supplied 
with Flex, and to reference your custom components. 
Custom components can reference other custom components. 
The Flex class hierarchy
Flex is implemented as an ActionScript class hierarchy. That class hierarchy contains 
component classes, manager classes, data-service classes, and classes for all other Flex features. 
The following example shows a portion of the class hierarchy for the Flex visual components, 
such as controls and containers: 
All visual components are derived from the 
UIComponent 
ActionScript class. Flex nonvisual 
components are also implemented as a class hierarchy in ActionScript. The most commonly 
used nonvisual classes are the Validator, Formatter, and Effect base classes.
You create custom components by extending the Flex class hierarchy using the MXML and 
ActionScript languages. Components inherit the properties, methods, events, styles, and 
effects of their superclasses. 
NO
TE
For a complete description of the class hierarchy, see the Adobe Flex 2 Language 
Reference
Container
NumericStepper
Button
ComboBase
UIComponent
Form
VBox
Box
ComboBox