that works well. and here i was thinking that i might have to create a 
composite component with an HScrollBar and VScrollBar. 

thank you. -- matt. 
  ----- Original Message ----- 
  From: Troy Gilbert 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, September 10, 2007 3:59 PM
  Subject: Re: [flexcoders] scrollRect confusion


  scrollRect just provides clipping, it does not add scrollbars, etc. For that, 
I'd recommend just putting your image component inside of a Canvas component.

  Troy.




  On 9/10/07, Matthew Ganz <[EMAIL PROTECTED]> wrote:
    hi. 

    i'm loading an image at runtime into an image component. i want the 
component to have horizontal and vertical scrollbars. the image is 300x300 and 
the image i'm loading in is 500x500. i thought i could simply define a 
rectangle for the 'scrollRect' property of the image but it doesn't appear to 
be working. 

    am i correct in thinking that i can do this? 

    here's the code (init() is called on creationComplete):

    [Bindable]
        private var viewPort:Rectangle;
        
        private function init():void{
         viewPort = new Rectangle(0, 0, 500, 500);
        }

    <mx:Image 
         width="300" 
         height="300" 
         showBusyCursor="true"
         source="{myRuntimeImage}"
         scrollRect="{viewPort}"/>

    any tips are appreciated. - thank you. -- matt. 



   

Reply via email to