PDA

View Full Version : how to call this function


stonyx
09-01-2006, 12:08 AM
hi all what i'm trying to do is to call borrarTodo() after 5 items added in my datagrid which is datagrid2 or maybe u have any other ideas
thanx

public function borrarTodo():void
{
_xlcdatagrid2.removeAll();
var numElements:int = _xlcdatagrid2.length;
if (numElements > 5) {
trace (borrarTodo());
}
}

stonyx
09-04-2006, 03:24 PM
i figure out the AS code but when i use the datachange in my datagrid comonent i get this error undefined method any ideas?
....
private function AutoB():void{
if (_xlcdatagrid2.length >= 2)
{
this._xlcdatagrid2.removeItemAt(0);
}
}
...
<mx:datagrid>
dataChange="datagrid2.selectedIndex.AutoB()"