MACROMEDIA FLASH 8-COMPONENTS LANGUAGE Reference page 1305

Components language reference
Table of Contents

Advertisement

Returns
Nothing.
Description
Method; updates the tree.
Example
The following example adds a node to a Tree instance called my_tr and creates listeners for a
Refresh button and a Remove All button. Assuming the XML source for the data provider has
changed, the user can click the Refresh button, and the code calls the
update the tree contents.
You must first add an instance of the Tree component to the Stage and name it
add a button called
refresh_button
main timeline:
/**
Requires:
- Tree component on Stage (instance name: my_tr)
- Button component on Stage (instance name: refresh_button)
*/
var my_tr:mx.controls.Tree;
var refresh_button:mx.controls.Button;
var removeAll_button:mx.controls.Button;
my_tr.setSize(200, 100);
var trDP_xml:XML = new XML();
trDP_xml.ignoreWhite = true;
trDP_xml.onLoad = function() {
my_tr.dataProvider = this.firstChild;
};
trDP_xml.load("http://yourXMLsourcehere");
function refreshListener(evt_obj:Object):Void {
my_tr.refresh();
}
refresh_button.addEventListener("click", refreshListener);
. Then add the following code to Frame 1 in the
method to
refresh()
. Then
my_tr
Tree.refresh()
1301

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash 8

Table of Contents