
Код:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application borderStyle="none" xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="appComplete();">
<mx:Script>
<![CDATA[
import mx.containers.Grid;
import mx.controls.Button;
import mx.containers.GridItem;
import mx.containers.GridRow;
private function appComplete():void
{
var gr:Grid = new Grid();
var bt:Button;
var rw:GridRow;
var it:GridItem;
for(var i:int = 0; i < 2; i++)
{
bt = new Button();
bt.label = "Foo";
bt.width = 100;
bt.height = 20;
rw = new GridRow();
rw.width = 120;
rw.height = 20;
it = new GridItem();
it.width = 120;
it.height = 20;
it.addChild(bt);
rw.addChild(it);
gr.addChild(rw);
}
gr.width = 120;
gr.height = 50;
this.addChild(gr);
}
]]>
</mx:Script>
</mx:Application>
Ну, например.