Flash – List Component

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.