PDA

View Full Version : Resized image occupies original size


hotelechoyankee
10-05-2007, 01:26 PM
hi, i'm very new to flex, so please bear with me if this is a stupid question.

when i add an image to a VBox and make it smaller, the next element in the VBox starts where the originally-sized image would end. how can i make it appear immediately below the smaller image?

below is a side-by-side comparison, scaled-down image on the left, full image on the right. notice the label is at the same height in both.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel width="450">
<mx:VBox width="300">
<mx:Image source="http://www.history.com/minisites/space/images/space_image.jpg" width="100%"/>
<mx:Label text="Some Text"/>
</mx:VBox>
</mx:Panel>
<mx:Panel x="450" width="450">
<mx:VBox width="400">
<mx:Image source="http://www.history.com/minisites/space/images/space_image.jpg"/>
<mx:Label text="Some Text"/>
</mx:VBox>
</mx:Panel>
</mx:Application>

drkstr
10-06-2007, 12:21 PM
I remember having a problem like this, and I ended up fixing it by setting explicit widths and heights to the image component. It's worth a shot at least.

Best Regards,
...aaron

hotelechoyankee
10-06-2007, 01:12 PM
yup, that did it. as soon as i added a value for height, the problem was fixed. thanks aaron :)