you cannot pass arguments to listeners callback functions. Try extends the buttonClass as follow:
package
{
public class MyButton extends Button
{
public var row:int;
public var col:int;
public function MyButton()
{
super();
}
}
}
After that you just have to fill the row and col property for the buttons.
for(var col:int = 1; col <= MaxColumn; col++){
for(var row:int = 1; row <= MaxRow; row++){
makeGrid(col, row);
Button["btn_" + col + "_" + row] = new MyButton();
Button["btn_" + col + "_" + row].col = col;
Button["btn_" + col + "_" + row].row = row;
//...
on the callback function you can retrieve it as follow:
private function onGridClick(e:Event):void
{
var b:MyButton = event.target as MyButton;
makeGridId(b.col, b.row);
var createGridDialog:CreateGridDialog = PopUpManager.createPopUp(this, CreateGridDialog, true) asCreateGridDialog;
PopUpManager.centerPopUp(createGridDialog);
createGridDialog.setGridId(globalGridId);
createGridDialog.setMaxRow(MaxRow);
createGridDialog.addEventListener(CreateGridEvent.GRID_SUBMIT, tmpSave);
}
PS: I warn you about the use of your array named Button exactly the same a s the class Button.
If you can use upercase first letters only for class name and keep lowercase first letter for variable, it's better (ex: MyClassName, myVariableName) ;)