<mx:VBoxxmlns:mx="http://www.adobe.com/2006/mxml" height="30" currentState="base" implements="mx.controls.listClasses.IDropInListItemRenderer" verticalScrollPolicy="off"> <mx:Script> <![CDATA[ import mx.controls.List; import mx.events.ListEvent; import mx.controls.listClasses.BaseListData; import mx.collections.ArrayCollection; privatefunction resizeFocusInHandler(event:Event):void { if ((_listData.owner as List).selectedIndex == ArrayCollection((_listData.owner as List).dataProvider).getItemIndex(this.data)&& currentState != "selected") { trace("functions"+_listData.rowIndex+" "+(_listData.owner as List).selectedIndex); currentState = "selected"; } elseif ((_listData.owner as List).selectedIndex != ArrayCollection((_listData.owner as List).dataProvider).getItemIndex(this.data)&& currentState == "selected") { currentState = "base"; } } override publicfunction set data(value:Object):void { txt.text = value as String; } override publicfunction get data():Object { return txt.text; } // Internal variable for the property value. privatevar _listData:BaseListData; // Make the listData property bindable. [Bindable("dataChange")] // Define the getter method. publicfunction get listData():BaseListData { return _listData; } // set the event listeners for the Change and Scroll events // that the List or Column will dispatch publicfunction set listData(value:BaseListData):void { _listData = value; _listData.owner.addEventListener(ListEvent.CHANGE, resizeFocusInHandler); _listData.owner.addEventListener(Event.SCROLL, resizeFocusInHandler); }