PDA

View Full Version : Creating simple Grid from action script


john100
02-12-2006, 03:06 AM
How to create below simple grid from action script?
In the beta version of as 3, it didnot have createchild in grid
var g:Grid = new Grid();
var gr:GridRow = new GridRow();
var gi:GridItem = new GridItem();

the has g.createChildId() but not create child.


<mx:Grid x="115" y="490">
<mx:GridRow>
<mx:GridItem>
</mx:GridItem>
<mx:GridItem>
</mx:GridItem>
</mx:GridRow>
<mx:GridRow>
<mx:GridItem>
</mx:GridItem>
<mx:GridItem>
</mx:GridItem>
</mx:GridRow>
</mx:Grid>

Thank you in advance.

john100
02-17-2006, 04:39 AM
Hmm.... look's like it is tough. no body has answer yet. or it is super simple. :0

haridsv
02-17-2006, 06:00 AM
Well, I don't understand what your question is about. You are already creating the right objects, you just need to add them using addChild() (row to the grid, items to the row, and your actual widgets to the items). If this is not what you are asking, you should try rephrasing your question.

Hari

hangalot
02-17-2006, 05:04 PM
oi patience mate. not all of us are in the same time zone. look at the example i posted in this forum to create a vbox dynamically

john100
02-17-2006, 07:42 PM
Thank you for the answer. the addChild() is the one that I am looking for. As hangalot mention, it is similar way to do in in VBox.

Now, I kind of understand how it's work. the addChild look's like being used over and over again. I am still new in ActionScript even though I programmed alot in other languages.

Thanks again, it solved my problems.
J