import fl.data.DataProvider;
import fl.controls.List;
var urlLoc:String = new String();
var dp:DataProvider = new DataProvider();
for (var i:uint = 1; i<=5; i++){
dp.addItem( { label:"Channel" +i ,ben : "musicList"+i+".xml"} );
}
var list:List = new List();
list.dataProvider = dp;
addChild(list);
list.setSize(140,60);
list.addEventListener(MouseEvent.CLICK, action);
function action(e:MouseEvent):void{
urlLoc = e.target.data.ben;
trace(urlLoc);
}
Its working fine and when I am click the down and up button its brings me an error.
“ReferenceError: Error #1069: Property data not found on fl.controls.BaseButton and there is no default value.
at Untitled_fla::MainTimeline/action() “
How could I solve this problem?
U made a problem with listener Object.
Change the event Handler
Event.CHANGEinstead of “MouseEvent.CLICK“.