PDA

View Full Version : needs help with Tree component


madhava
12-14-2004, 02:29 PM
Hi,

I really got a great response for the last thread which i posted. Thanks a lot.

I have one more small problem with tree component. My xml file reads like this:

<brands>
<node label="Full Solutions">
<node label="Consolidation">
<node label="Storage" />
<node label="xSeries" />
<node label="pSeries" />
<node label="zSeries" />
<node label="iSeries" />
<node label="PCD" />
</node>
<node label="ISV Applications">
<node label="Storage" />
<node label="xSeries" />
<node label="pSeries" />
<node label="zSeries" />
<node label="iSeries" />
<node label="PCD" />
</node>
<node label="e-Business Applications">
<node label="Storage" />
<node label="xSeries" />
<node label="pSeries" />
<node label="zSeries" />
<node label="iSeries" />
<node label="PCD" />
</node>
</node>
</brands>

Iam reading this xml from my flash and populating the data in the tree component like this.

var myTreeDP:XML = new XML();
myTreeDP.ignoreWhite = true;
myTreeDP.load("SampleXMLFile.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.attributes.label);
};
myTree.addEventListener("change", treeListener);


If the user has clicked on the xSeries I want to trace the value as
Full solutions-consolidation-xSeries

Now iam able to trace which node he has clicked.

Please help me.

Thanks in advance.
Madhava ram upadrasta