Groups | Blog | Home
all groups > flash data integration > august 2005 >

flash data integration : XML to Flash Tree



nicky2005
8/23/2005 11:22:23 AM
Hi,

I'm using XML to build a tree in Flash MX using the following code. The code
that opens a node, assigns an icon and sets the node as a branch is not
working. If anyone can help I would appreciate it.


<?xml version="1.0" encoding="iso-8859-1"?>
<node id = "0" open="Y" label="property" level="0">
<node ref="0" id = "260" icon="house" isBranch="true" open="Y"
label="Changeover 0" level = "1"/>
<node ref="1" id = "260" icon="house" isBranch="true" open="Y"
label="Changeover 1" level =
"1">
<node ref="2" id = "1664" icon="house" label="Sold By" level = "2"/>
<node ref="3" id = "1664" icon="house" label="Sold By" level = "2"/>
</node>
<node ref="4" id = "260" icon="house" isBranch="true" open="Y"
label="Changeover 4" level = "1">
<node ref="5" id = "25003" icon="house" label="Ouch" level = "2"/>
</node>
<node ref="6" id = "260" icon="house" isBranch="true" open="Y"
label="Changeover 6" level = "1">
<node ref="7" id = "25002" icon="house" label="Now" level = "2"/>
</node>
<node ref="8" id = "101" icon="house" isBranch="true" open="Y"
label="STANDARD 8" level = "1">
<node ref="9" id = "1661" icon="house" label="Sold Subject to Contract" level
= "2"/>
</node>
</node>


Rajesh199
8/27/2005 7:08:19 AM
hey !
use this code!!
//

var myTreeDP:XML = new XML();
myTreeDP.ignoreWhite = true;
myTreeDP.load("tree.xml");
myTreeDP.onLoad = function() {
myTree.dataProvider = this.firstChild;
};
var treeListener:Object = new Object();
treeListener.change = function(evt:Object) {
trace("selected node is: "+evt.target.selectedNode);

};
myTree.addEventListener("change", treeListener);

////
Rajesh
:D
AddThis Social Bookmark Button