RE: [flexcoders] scrollRect ???

2009-09-24 Thread Alex Harui
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: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of flexaustin
Sent: Wednesday, September 23, 2009 10:35 PM
To: flexcoders@yahoogroups.com
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 xy position 
relative to the vis xy 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 XY 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



[flexcoders] scrollRect ???

2009-09-23 Thread flexaustin
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 xy position 
relative to the vis xy 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 XY 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



[flexcoders] scrollRect width and height - flexaustin

2009-04-27 Thread flexaustin
I have tried increasing the width/ height of the scrollRect once its been set, 
say your swf scales ot the window size, but nothing will increase its width or 
height. 

So, instead of increaseing and decreasing the width and height of the 
scrollRect when the stage is resized I just create and assign a new rectangle 
to the components scrollRect property setting its width and height to the new 
stage size.  

Is there a better solution? As trying component.scrollRect.width = newSize does 
nothing to the scrollRect.

Any better solutions?



RE: [flexcoders] scrollRect width and height - flexaustin

2009-04-27 Thread Alex Harui
Many complex properties in Flash and Flex (arrays, rectangles, etc) need to be 
fully re-assigned as there is no way to watch each property for changes.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.http://www.adobe.com/
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of flexaustin
Sent: Monday, April 27, 2009 12:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] scrollRect width and height - flexaustin





I have tried increasing the width/ height of the scrollRect once its been set, 
say your swf scales ot the window size, but nothing will increase its width or 
height.

So, instead of increaseing and decreasing the width and height of the 
scrollRect when the stage is resized I just create and assign a new rectangle 
to the components scrollRect property setting its width and height to the new 
stage size.

Is there a better solution? As trying component.scrollRect.width = newSize does 
nothing to the scrollRect.

Any better solutions?



[flexcoders] scrollRect confusion

2007-09-10 Thread Matthew Ganz
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. 

Re: [flexcoders] scrollRect confusion

2007-09-10 Thread Troy Gilbert
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.
 



Re: [flexcoders] scrollRect confusion

2007-09-10 Thread Matthew Ganz
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.