Missed the return void. private function myEventHandler( event:ListEvent ):void { // do something }
-TH --- In flexcoders@yahoogroups.com, "Tim Hoff" <timh...@...> wrote: > > > Just a syntax problem. Should be like this: > > var client:AdvancedDataGrid = new AdvancedDataGrid; > client.dataProvider = ArrayResults; > client.addEventListener( ListEvent.ITEM_CLICK , myEventHandler ); > > private function myEventHandler( event:ListEvent ) > { > // do something > } > > -TH > > Also, I'd suggest that you use an ArrayCollection instead of an array; > if you want to do any data manipulation. > > --- In flexcoders@yahoogroups.com, "lehaianh1986" lehaianh1986@ > wrote: > > > > Hi every body. I have a AdvancedDatagird and dataprovider from Array > Collection. How to listen an event when I click to each row? I want use > an event when I click left mouse, right mouse, double click,...etc > > > > My code is here but it not run > > > > var client:AdvancedDataGrid = new AdvancedDataGrid; > > client.dataProvider = ArrayResults; > > > client.addEventListener(ListEvent.ITEM_CLICK,function(event:ListEvent):v\ \ > oid > > { > > ... > > }); > > >