View comments | RSS feed

Tree class (Flash Professional only)

Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView > ScrollSelectList > List component > Tree

ActionScript Class Name mx.controls.Tree

The methods, properties, and events of the Tree class allow you to manage and manipulate Tree objects.

Method summary for the Tree class

The following table lists methods of the Tree class.

Method

Description

Tree.addTreeNode()

Adds a node to a Tree instance.

Tree.addTreeNodeAt()

Adds a node at a specific location in a Tree instance.

Tree.getDisplayIndex()

Returns the display index of a given node.

Tree.getIsBranch()

Specifies whether the folder is a branch (has a folder icon and an expander arrow).

Tree.getIsOpen()

Indicates whether a node is open or closed.

Tree.getNodeDisplayedAt()

Maps a display index of the tree onto the node that is displayed there.

Tree.getTreeNodeAt()

Returns a node on the root of the tree.

Tree.refresh()

Updates the tree.

Tree.removeAll()

Removes all nodes from a Tree instance and refreshes the tree.

Tree.removeTreeNodeAt()

Removes a node at a specified position and refreshes the tree.

Tree.setIcon()

Specifies an icon for the specified node.

Tree.setIsBranch()

Specifies whether a node is a branch (has a folder icon and expander arrow).

Tree.setIsOpen()

Opens or closes a node.

Methods inherited from the UIObject class

The following table lists the methods the Tree class inherits from the UIObject class. When calling these methods from the Tree object, use the form TreeInstance.methodName.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from the UIComponent class

The following table lists the methods the Tree class inherits from the UIComponent class. When calling these methods from the Tree object, use the form TreeInstance.methodName.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Methods inherited from the List class

The following table lists the methods the Tree class inherits from the List class. When calling these methods from the Tree object, use the form TreeInstance.methodName.

Method

Description

List.addItem()

Adds an item to the end of the list.

List.addItemAt()

Adds an item to the list at the specified index. With the Tree component, it is better to use Tree.addTreeNodeAt().

List.getItemAt()

Returns the item at the specified index.

List.removeAll()

Removes all items from the list.

List.removeItemAt()

Removes the item at the specified index.

List.replaceItemAt()

Replaces the item at the specified index with another item.

List.setPropertiesAt()

Applies the specified properties to the specified item.

List.sortItems()

Sorts the items in the list according to the specified compare function.

List.sortItemsBy()

Sorts the items in the list according to a specified property.

Property summary for the Tree class

The following table lists properties of the Tree class.

Property

Description

Tree.dataProvider

Specifies an XML data source.

Tree.firstVisibleNode

Specifies the first node at the top of the display.

Tree.selectedNode

Specifies the selected node in a Tree instance.

Tree.selectedNodes

Specifies the selected nodes in a Tree instance.

Properties inherited from the UIObject class

The following table lists the properties the Tree class inherits from the UIObject class. When accessing these properties from the Tree object, use the form TreeInstance.propertyName.

Property

Description

UIObject.bottom

Read-only; the position of the bottom edge of the object, relative to the bottom edge of its parent.

UIObject.height

Read-only; the height of the object, in pixels.

UIObject.left

Read-only; the left edge of the object, in pixels.

UIObject.right

Read-only; the position of the right edge of the object, relative to the right edge of its parent.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

Read-only; the position of the top edge of the object, relative to its parent.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

Read-only; the width of the object, in pixels.

UIObject.x

Read-only; the left edge of the object, in pixels.

UIObject.y

Read-only; the top edge of the object, in pixels.

Properties inherited from the UIComponent class

The following table lists the properties the Tree class inherits from the UIComponent class. When accessing these properties from the Tree object, use the form TreeInstance.propertyName.

Property

Description

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tab order for a component in a document.

Properties inherited from the List class

The following table lists the properties the Tree class inherits from the List class. When accessing these properties from the Tree object, use the form TreeInstance.propertyName.

Property

Description

List.cellRenderer

Assigns the class or symbol to use to display each row of the list.

List.dataProvider

The source of the list items.

List.hPosition

The horizontal position of the list.

List.hScrollPolicy

Indicates whether the horizontal scroll bar is displayed ("on") or not ("off").

List.iconField

A field in each item to be used to specify icons.

List.iconFunction

A function that determines which icon to use.

List.labelField

Specifies a field of each item to be used as label text.

List.labelFunction

A function that determines which fields of each item to use for the label text.

List.length

The number of items in the list. This property is read-only.

List.maxHPosition

The number of pixels the list can scroll to the right, when List.hScrollPolicy is set to "on".

List.multipleSelection

Indicates whether multiple selection is allowed in the list (true) or not (false).

List.rowCount

The number of rows that are at least partially visible in the list.

List.rowHeight

The pixel height of every row in the list.

List.selectable

Indicates whether the list is selectable (true) or not (false).

List.selectedIndex

The index of a selection in a single-selection list.

List.selectedIndices

An array of the selected items in a multiple-selection list.

List.selectedItem

The selected item in a single-selection list. This property is read-only.

List.selectedItems

The selected item objects in a multiple-selection list. This property is read-only.

List.vPosition

Scrolls the list so the topmost visible item is the number assigned.

List.vScrollPolicy

Indicates whether the vertical scroll bar is displayed ("on"), not displayed ("off"), or displayed when needed ("auto").

Event summary for the Tree class

The following table lists events of the Tree class.

Event

Description

Tree.nodeClose

Broadcast when a node is closed by a user.

Tree.nodeOpen

Broadcast when a node is opened by a user.

Events inherited from the UIObject class

The following table lists the events the Tree class inherits from the UIObject class.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

The following table lists the events the Tree class inherits from the UIComponent class.

Event

Description

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.

Events inherited from the List class

The following table lists the events the Tree class inherits from the List class.

Event

Description

List.change

Broadcast whenever user interaction causes the selection to change.

List.itemRollOut

Broadcast when the pointer rolls over and then off list items.

List.itemRollOver

Broadcast when the pointer rolls over list items.

List.scroll

Broadcast when a list is scrolled.


Version 8

Comments


No screen name said on Nov 2, 2006 at 6:39 AM :
Where is the Tree.removeTreeNode() method? There's only Tree.removeTreeNodeAt(), but Tree.removeTreeNode() still works...

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00004122.html