Using the List Component in Flash is very handy to use when for example using cue points as listitems..
Here are an example of how to use the listcomponent in AS3
//Define new list and add to stage
list = new List();
list.x = 100;
list.y = 100;
stage.addChild(list);
///AddItems
list.addItem({label:"3. Einde", data:"einde"});
//Check for Click
list.addEventListener(ListEvent.ITEM_CLICK, switchIndex);
private function switchIndex(e:ListEvent){
//Item Index
trace(e.index);
//Current Item
trace(e.item);
//Current Item Data
trace(e.item.data);
//...
}
Full Detailed description of ListEvent:
Here
Advertisement