User Guide
componentsPanel object 55
componentsPanel object
Availability
Flash MX 2004.
Description
The componentsPanel object, which represents the Components panel, is a property of the flash
object and can be accessed by
fl.componentsPanel.
Method summary for the ComponentsPanel object
You can use the following method with the componentsPanel object:
componentsPanel.addItemToDocument()
Availability
Flash MX 2004.
Usage
componentsPanel.addItemToDocument( position, categoryName, componentName )
Parameters
position
A point (for example, {x:0, y:100}) that specifies the location at which to add the
component. Specify
position relative to the center point of the component—not the
component’s registration point.
categoryName A string that specifies the name of the component category (for example, "Data
Components
"). The valid category names are listed in the Components panel.
componentName A string that specifies the name of the component in the specified category
(for example, "
WebServiceConnector"). The valid component names are listed in the
Components panel.
Returns
Nothing.
Description
Adds the specified component to the document at the specified position.
Examples
The following examples illustrate some ways to use this method:
fl.componentsPanel.addItemToDocument({x:0, y:0}, "UI Components", "CheckBox");
fl.componentsPanel.addItemToDocument({x:0, y:100}, "Data Components",
"WebServiceConnector");
fl.componentsPanel.addItemToDocument({x:0, y:200}, "UI Components", "Button");
Property Description
componentsPanel.addItemToDocument() Adds the specified component to the document at the
specified position.
CHAPTER 3
Objects