![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
To add a component to a document using ActionScript, you must first add it to the library.
You can use ActionScript methods to set additional parameters for dynamically added components. For more information, see Components Dictionary.
Note: The instructions in this section assume an intermediate or advanced knowledge of ActionScript.
This adds the component to the library.
createClassObject()
method to create the component instance at runtime.
This method can be called on its own, or from any component instance. It takes a component class name, an instance name for the new instance, a depth, and an optional initialization object as its parameters. You can specify the class package in the className
parameter, as in the following:
createClassObject(mx.controls.CheckBox, "cb", 5, {label:"Check Me"});
Or you can import the class package, as in the following:
import mx.controls.CheckBox; createClassObject(CheckBox, "cb", 5, {label:"Check Me"});
For more information, see UIObject.createClassObject()
.
For detailed information on the ActionScript methods and properties available to each component, see their entries in Components Dictionary.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |