Hi all I have an mxml canvas component with grid and I have in the mx:Script tag a public function that add a GridItem child into the grid. When I call this public function thorugh my main application and run the project, it stuck. so how can I do this? how to change my grid in the canvas through my main application and why my code doesn't work. Thank you guys. Regrads. elad.
my code:
the grid in the canvas:
mx:Grid left="10" right="10" top="92" bottom="26" id="grid" borderStyle="solid" borderColor="#545454"
/mx:Grid
the public function in the same mxml:
public function SetGrid(rows:int, columns:int):void
{
for (var i:int=0;i>rows;i++)
{
var newGridRow:GridRow = new GridRow();
for (var j:int=0;j>columns;j++)
{
var newGridItem:GridItem = new GridItem();
newGridItem.id = "i-j";
newGridRow.addChild(newGridItem);
}
grid.addChild(newGridRow);
}
}