获取鼠标滑过的节点信息(itemRollOver)--------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.listClasses.IListItemRenderer;
import mx.events.ListEvent;
private function itemRollOverHandler(e:ListEvent):void
{
var renderer:IListItemRenderer = contentTree.indexToItemRenderer(e.rowIndex);
trace('item rollover: ' + renderer.data.@value);
}
]]>
</fx:Script>
<fx:Declarations>
<fx:XMLList id="mydata">
<item value="1">
<item value="1.1"/>
<item value="1.2"/>
</item>
<item value="2"/>
<item value="3"/>
</fx:XMLList>
</fx:Declarations>
<mx:Tree id="contentTree" width="200" height="50%" dataProvider="{mydata}"
itemRollOver="itemRollOverHandler( event )" labelField="@value" showRoot="false"/>
</s:Application>