PDA

View Full Version : Flex 3 vBox Question


arone
02-11-2009, 01:13 PM
I have a vbox which is that target to for some images im trying to load in. everything works fine but rather than the first image loading at the top of the vBox, id like it to load from the bottom, - any ideas?

wvxvw
02-11-2009, 01:46 PM
How do you load the images?

eric.carlisle
02-11-2009, 03:28 PM
Like wvxvw says, depends on how you're loading.

Is this what you're looking for?

<mx:VBox verticalAlign="bottom">

</VBox>

Peter Cowling
02-11-2009, 04:55 PM
If I read you correctly, part of the solution relates to child addition / positioning. You need to make sure that children being added to the VBox are added before their companions - rather than into the last child position.

Combine that with the a vertical alignment that is tied to the bottom of the VBox, and you should have the solution you require.

As an aside though, I try to avoid VBoxes and HBoxes altogether, and definitely in situations like the one you describe. Why? Because they include performance overhead that is not paying its way.

arone
02-12-2009, 04:30 AM
Thanks for the information guys.

im creating the images with actionscript and loading them using addChild();

seen here in its simplest form:

var myImg:Image = new Image();
myImg.source = evt.target.id + ".png";
myVbox.addChild(myImg);


Setting the vertical align to "bottom" solves most of my issues. although Im not sure a vBox is the right tool to be using. See, im trying to generate a composite image of a floor diagram. It would consits of 4 image/layers defined by 4 differnt comboBox's. But but certain layers need to be on top of the other images at all times, Like the carpet layer for example.

In confusing, i know - thanks for the help :)