MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 51

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

The following example adds the
MyButton class:
class MyButton extends mx.controls.Button {
static var symbolName:String = "myPackage.MyButton";
static var symbolOwner = myPackage.MyButton;
var className:String = "MyButton";
...
}
About the component instantiation life cycle
When you instantiate a new component, Flex calls a number of methods, and those methods call
other methods that you can override. Instantiating a new control in your application triggers the
following method calls by Flex:
Class constructor
1.
After the class constructor is called, Flex calls the
The
2.
constructObject2()
When you implement the
super.constructObject2()
createChildren()
The
method
3.
init()
Flex calls the
The
4.
createChildren()
Flex calls the
method.
The
5.
measure()
Flex calls the
The
6.
layoutChildren()
Flex calls the
The
method
7.
draw()
Flex calls the
Each of the
measure()
function. For more information, see
The remaining sections describe each of these methods. For the purposes of initialization, you do
not need to add any explicit calls to these methods, because Flex initiates each call. However, you
might be required to explicitly call some of these methods to refresh the object's state after it has
been created and displayed.
symbolName
method
constructObject2()
method or make manual calls to the
methods.
method from the parent class's
init()
method
method from the parent class's
createChildren()
method
method.
measure()
method
method.
layoutChildren()
method.
draw()
,
layoutChildren()
"About invalidation" on page
,
, and
symbolOwner
className
constructObject2()
method, you must call the
constructObject2()
, and
methods has a corresponding invalidate
draw()
Writing the component's ActionScript code
properties to the
method.
and
init()
method.
constructObject2()
68.
51

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flex

Table of Contents