Create a gist now

Instantly share code, notes, and snippets.

@takumus /Demo.as Secret
Created Dec 19, 2016

What would you like to do?
_list = new List(SimpleCell, 50, 0, new SimpleScrollBar());
addChild(_list);
//add data to list
_list.setData("ABCDEGFHIJKLMNOPQRSTU".split(""));
//add message event from cell
_list.addEventListener(ListEvent.MESSAGE, function(event:ListEvent):void{
log("message : {id:"+event.cellData.id + ", message:\"" + event.message + "\"}\n");
});
//add update event
_list.addEventListener(ListEvent.UPDATE, function(event:ListEvent):void{
log("updated : [");
var tmpData:Array = _list.getData();
for(var i:int = 0; i < tmpData.length; i ++){
var data:String = tmpData[i];
log(data+",");
}
log("]\n");
});
//add remove event
_list.addEventListener(ListEvent.REMOVE, function(event:ListEvent):void
{
log("removed : {id:"+event.cellData.id + ", data:" + event.cellData.data.toString() + "}\n");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment