As I am using the Spark List component extensively in my current project, I have come to understand some of the differences between a Spark List and MX List. I thought it would make sense to post my experience with this.
With MX components, you have an itemClick Event on your List component. So you can capture clicks on Individual items. Something like this :-
<fx:Script>
<![CDATA[
import mx.events.ListEvent;
protected function myList_itemClickHandler(event:ListEvent):void
{
trace(event.currentTarget.selectedItem.label);
}
]]>
</fx:Script>
<mx:List width="200"
id="myList"
itemClick="myList_itemClickHandler(event)"
dataProvider="{ds}" />
So, this is cool. However, in Spark, there is no such event. In a Spark List, you have to listen to the change event which fires off an IndexChangeEvent every time the List Index changes – which makes sense. So, your code will look like this in this case:- Read the rest of this entry »