The following table describes the arguments:
Argument
className
instanceName
depth
initObject
To call the
createClassObject()
a border or a button that you always need), because you must specify the name and type of the
object, plus any initialization parameters in the call to
The following example calls the
use inside a component:
up_mc.createClassObject(Label, "label_mc", 1); // Create a label in the holder
You set properties in the call to the
argument. The following example sets the value of the
initObject
form.createClassObject(CheckBox, "cb", 0, {label:"Check this"});
The following example creates TextInput and SimpleButton components:
function createChildren():Void {
if (text_mc == undefined)
createClassObject(TextInput, "text_mc", 0, { preferredWidth: 80,
editable:false });
text_mc.addEventListener("change", this);
text_mc.addEventListener("focusOut", this);
if (mode_mc == undefined)
createClassObject(SimpleButton, "mode_mc", 1, { falseUpSkin:
modeUpSkinName, falseOverSkin: modeOverSkinName, falseDownSkin:
modeDownSkinName });
mode_mc.addEventListener("click", this);
}
If your component is a container, and you do not know exactly which children it contains, call the
createComponents()
using the
createComponents()
At the end of the
(
,
invalidate()
information, see
Implementing the commitProperties() method
Flex calls the
commitProperties()
chance to set variables that are used by the
and MXML attributes have been applied.
Type
Object
String
Number
Object
method, you must know what those children are (for example,
createClassObject()
createClassObject()
method. This method creates all child objects. For more information on
method, see Developing Flex Applications.
method, call the necessary invalidate methods
createChildren()
, or
invalidateSize()
"About invalidation" on page
method before it calls the
Description
The name of the class.
The name of the instance.
The depth for the instance.
The object that contains the initialization properties.
createClassObject()
method to create a new Label object for
method by adding them as part of the
invalidateLayout()
68.
measure()
method after the constructor has finished
measure()
Writing the component's ActionScript code
.
property:
label
) to refresh the screen. For more
method. It provides a
55
Need help?
Do you have a question about the FLEX - DEVELOPING COMPONENTS AND THEMES and is the answer not in the manual?