I'm pretty sure scrollrects are always positioned at 0,0. It essentially creates a mask of a certain size, positions it at 0,0, then only shows the pixels that would otherwise be displayed at x,y at 0,0
Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui From: [email protected] [mailto:[email protected]] On Behalf Of flexaustin Sent: Wednesday, September 23, 2009 10:35 PM To: [email protected] Subject: [flexcoders] scrollRect ??? Wondering if anyone knows how to get the difference between the scrollRect x position relative to the components edges? I am building a pancontrol, similar to the ones found Google Maps or Yahoo Maps, for quick navigation. In order to setup my pancontrol I need to find out the following given this code: <Application... ...... <mx:Canvas id="compHolder" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" > <components:myComp id="vis" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" backgroundAlpha="0" scrollRect="{rec}" cacheAsBitmap="true" mouseUp="handleVisMouseUp()" /> </mx:Canvas> I need to find the distance or gap between the vis.scrollRect x&y position relative to the vis x&y position. My application width & height are 600 x 600. Vis width and height are 3000 x 900 so they extend off screen. I am using the scrollRect to limit what is viewable. But in order build my pancontrol I need to find the diff between the X & Y of the scrollRect in relation to the X&Y of the Vis. So how far off left, right, bottom, and top of the visible area does Vis extend. I need those numbers in pixels. TIA, J

