9 Replies Latest reply on Apr 28, 2009 11:00 AM by Brent Lamborn

    9 slicing an embedded image with Flex

    Brent Lamborn

      I'm trying to 9 slice an image using the technique described here:

       

      http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html

       

      Here is my mxml:

       

       

      <?xml version="1.0"?>
      
      <mx:Application
       xmlns:mx="http://www.adobe.com/2006/mxml" > 
      
      
           <mx:Script>
                <![CDATA[
      
                     /* Title box */               [
      Embed("assets/images/titlebox.png", scaleGridTop="2", scaleGridBottom="20", scaleGridLeft="30", scaleGridRight="90")]               [
      
      Bindable]public var titleBox:Class;           ]]>
      
      
           </mx:Script>
      
      
           <mx:HBox>
      
                <mx:Image source="{titleBox}" width="500" />
      
           </mx:HBox>
      </mx:Application>
      
      

       

       

           I'd like the small white box in the image to remain, while the right portion scales to fit a label I will place over the image. Right now with the above code, the image appears the same, no matter what I put in the width parameter.

       

      Can anyone help? Attached is TitleBox.png