MACROMEDIA FLEX - DEVELOPING COMPONENTS AND THEMES Manual page 54

Developing flex components and themes in flash authoring
Table of Contents

Advertisement

Implementing the constructObject2() method
The
constructObject2()
UIObject.constructObject2()
should apply any properties in the initObj that are needed by
and then call
super.constructObject2()
The
constructObject2()
constructObject2(initObj:Object):Void
In addition, if you use clip parameters, you should add a call to the
at the end of the
function constructObject2(o:Object):Void {
super.constructObject2(o);
applyProperties(o, Label.prototype.clipParameters);
}
If you override the
super.constructObject2()
The initObj contains all the component instance's properties that are set in the MXML tag
(and stored as clip parameters). Flex creates this object implicitly during instantiation of the
component.
Implementing the init() method
Flash calls the
init()
should call the superclass's
properly set until after this method is called.
function init(Void):Void {
super.init();
}
The implicit init object (initObj) contains everything passed in through the
the
createClassObject()
Note: Do not create child objects in the
properties.
Implementing the createChildren() method
Components implement the
components) in the component. Rather than calling the subobject's constructor in the
createChildren()
of your component.
The
createClassObject()
createClassObject(className, instanceName, depth, initObject)
54
Chapter 3: Creating Advanced Components in Flash MX 2004
method is effectively the constructor for your class. The
method calls the
method has the following signature:
constructObject2()
constructObject2()
method.
method when the class is created. At a minimum, the
method. The
init()
method. You can access it in the
init()
createChildren()
method, call the
createClassObject()
method has the following signature:
and
init()
init()
.
method; for example:
method, you must at least call the
,
width
height
init()
method. You should use it only for setting up initial
method to create subobjects (such as other
method to instantiate a subobject
methods. It
createChildren()
and
createChildren()
applyProperties()
method
init()
, and
parameters are not
clip
argument to
initObj
method.
,
method

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents