<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white" horizontalAlign="left">
<mx:Script>
<![CDATA[
[Bindable]
public var selectedNode:XML;
private function treeHandler(event:Event):void
{
selectedNode =Tree(event.target).selectedItem as XML;
}
]]>
</mx:Script>
<mx:XMLList id="xmlDP">
<node>
<node label="one" >
<node label="1" />
<node label="2" />
<node label="3" />
<node label="4" />
<node label="5" />
</node>
<node label="two" >
<node label="6" />
<node label="7" />
<node label="8" />
<node label="9" />
<node label="10" />
<node label="11" />
</node>
<node label="three" >
<node label="12" />
<node label="13" />
<node label="14" />
<node label="15" />
</node>
<node label="four" >
<node label="Proin nulla." />
<node label="16" />
<node label="17" />
</node>
<node label="five" />
</node>
</mx:XMLList>
<mx:HDividedBox width="100%" height="100%">
<mx:Tree id="tree"
dataProvider="{xmlDP}"
showRoot="false"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
width="30%" labelField="@label"
rowCount="6" height="100%" change="treeHandler(event)"/>
<mx:TextArea height="100%" width="70%" text="Selected Item: {selectedNode.@label}"/>
</mx:HDividedBox>
</mx:Application>