This actually from a change event, but an itemClicked one is very
similar ...
(It presumes that you use xml as the dataprovider for the tree, and
listen for the event by adding 'change="onTreeChange(event)"' in your
trees attributes )

private function onTreeChange(event:ListEvent):void
    var targetTree:Tree = as Tree; 
     var item:XML = XML(targetTree.selectedItem);
     var theParent:XML = item.parent();

It does seem a bit unintuitive to get an XML object, but normally that
works fine for what you're likely to want to do, I've found.

Hope that's enough to be helpful!

-----Original Message-----
From: [] On
Behalf Of hworke
Sent: 02 March 2009 21:18
Subject: [flexcoders] tree control finding patent node

Hi, in a tree control if a leaf node if clicked
how do I find out which folder it belongs to or
which node is its parent?


This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.

Reply via email to