User Guide
156 Creating Advanced Visual Components in ActionScript
■ “Basic component structure” on page 156
■ “Implementing the constructor” on page 157
■ “Implementing the createChildren() method” on page 157
■ “Implementing the commitProperties() method” on page 158
■ “Implementing the measure() method” on page 162
■ “Implementing the layoutChrome() method” on page 166
■ “Implementing the updateDisplayList() method” on page 166
Basic component structure
The following example shows the basic structure of a Flex component:
package myComponents
{
public class MyComponent extends UIComponent
{
....
}
}
You must define your ActionScript custom components within a package. The package
reflects the directory location of your component within the directory structure of your
application.
The class definition of your component must be prefixed by the
public keyword. A file that
contains a class definition can have one, and only one, public class definition, although it can
have additional private class definitions.