1 Reply Latest reply on May 28, 2009 9:57 AM by Steve Howard, ACP

    Text beneath scaled image in VBox component displayed in wrong location

    Steve Howard, ACP Level 3

      I have a simple MXML component, based on a VBox. In it I have 4 components, Text, Text, Image, Text. The image is set to fill 95% of available width, and maintainAspectRation + scaleContent are both true.

       

      I've tried various options, but I cannot get the Text that follows the Image to display directly beneath the Image; my intention is that this text is a label for the image.

       

      Here's the code I have. I'd appreciate uggestions as to how I can get the text to display where I need it.

        • 1. Re: Text beneath scaled image in VBox component displayed in wrong location
          Steve Howard, ACP Level 3

          Code:

           

           

           

          <?xml version="1.0" encoding="utf-8"?>

          <mx:VBox

           

           

           

           

           

          xmlns:mx=http://www.adobe.com/2006/mxml

          dropShadowEnabled="

          true"

          dropShadowColor="#808080"

          borderThickness="1" borderStyle="solid">

           

           

           

           

               <mx:Text text="{titleText}" paddingTop="8" width="100%"fontWeight="bold"/>

           

           

           

           

               <mx:Text htmlText="{bodyText}" width="100%" paddingTop="8"/>

                    <mx:HBox horizontalAlign="center" width="100%" >

           

           

           

           

                        <mx:Image source="{imageName}" width="95%" maintainAspectRatio="true" scaleContent="true" />

           

           

           

           

                    </mx:HBox>

               <mx:Text htmlText="{imageLabel}" width="100%" paddingTop="8"/>

           

           

           

          </mx:VBox>