beautypg.com

Chapter 9: componentspanel object, Componentspanel.additemtodocument() – Adobe Extending Flash Professional CS5 User Manual

Page 71

background image

49

Last updated 5/2/2011

Chapter 9: componentsPanel object

Availability
Flash MX 2004.

Description
The componentsPanel object, which represents the Components panel, is a property of the flash object (fl) and can be
accessed by

fl.componentsPanel

(see

flash object (fl)

).

Method summary
You can use the following methods 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 (also origin point or
zero point).

categoryName

A string that specifies the name of the component category (for example,

"Data"

). 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.

Example
The following examples illustrate some ways to use this method:

Method

Description

componentsPanel.addItemToDocument()

Adds the specified component to the document at the specified
position.

componentsPanel.reload()

Refreshes the Components panel's list of components.

This manual is related to the following products: