I don’t see you adding hgWeek’s to a parent.
On 6/21/10 1:52 PM, Scott h...@netprof.us wrote:
I’m trying to draw a calendar grid using HGroup and VGroup
If I do the follow it draws 7 boxes:
for (var nDay:int = 0; nDay 7; nDay++)
{
var bcBox:BorderContainer = new BorderContainer();
var lblCalText:Label = new Label();
var vgWeek:VGroup = new VGroup();
bcBox.height = 100;
bcBox.width = 133;
vgWeek.height = 100;
vgWeek.width = 133;
lblCalText.text = “test”;
vgWeek.addElement(lblCalText);
bcBox.addElement(vgWeek);
hgTest.addElement(bcBox);
}
...
s:HGroup x=5 y=27 width=957 height=100 id=hgTest/
I was thinking great… No problem…
So I decided to draw 5 weeks worth of boxes so I added in the following code:
for ( var nWeek:int = 0; nWeek 5; nWeek++)
{
var hgWeek:HGroup = new HGroup(); // row of Days
hgWeek.height = 100;
hgWeek.width = 957;
hgWeek.x = 25;
hgWeek.y = 5 + ( nWeek * 100); // shift the row down 100px
for (var nDay:int = 0; nDay 7; nDay++)
{
var bcBox:BorderContainer = new BorderContainer(); // Box around
the day
var lblCalText:Label = new Label(); //
var vgWeek:VGroup = new VGroup(); // Days in the Row
bcBox.height = 100;
bcBox.width = 133;
vgWeek.height = 100;
vgWeek.width = 133;
lblCalText.text = “test”;
vgWeek.addElement(lblCalText);
bcBox.addElement(vgWeek);
hgWeek.addElement(bcBox);
}
}
When I add in the weeks nothing draws. If I point the last hgTest.addElement
in then it works just fine…
Any ideas on what I’m doing wrong?
Thanks!
--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui