Yes, this is exactly what I was thinking...

The benefits are, it's impossible to drag the content off the screen, as
you are ultimately "remote controlling the scrollbars" to handle the
movement of the content.  It just "looks" like you are using the mouse
to pan things around.

So what you are both saying then, is I should just listen for the Mouse
Movements, and have it update the Horizontal & Vertical Scrollbars?

I don't have much experience, messing around with Scrollbars and their
associated values.

Is it as simple as listening for the changes in X,Y - and if there are
changes in the "X" axis, then trigger a function to change the
Horizontal Scroll?  And then in the "Y", change the Vertical?

This topic is very interesting to me, and I'd love to hear more on how
to accomplish something like this.

Thanks in advance Doug and Mike :)

Mike

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dougmccune
Sent: Wednesday, February 07, 2007 6:36 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Can drag-able content within a container,
update it's Scrollbars?

If it's really a matter of scrolling a container that has scrollbars by
dragging the contents, I would use a mouselistener (as mike
suggested) that would update the verticalScrollPosition and
horizontalScrollPosition of the parent container. You wouldn't actually
be "moving" the inner stuff at all. You would sort of be faking the
dragging.

Why do it like this? 1. dragging too far one way or the other wouldn't
drag the inner components out of the viewable area, 2. if you actually
wanted to use the scrollbars as well then they would still work (and
they would update correctly as you're dragging)

Just my two cents.

Doug


--- In flexcoders@yahoogroups.com, Jeff Tapper <[EMAIL PROTECTED]> wrote:
>
> I think i need to respectfully disagree on this.  For the type of
panning 
> of elements within a container, i think startDrag and stopDrag
should suit 
> his needs nicely.
> 
> At 06:04 AM 2/4/2007, Michael Schmalle wrote:
> 
> >Hi Mike
> >
> >Check out the <http://Panel.as>Panel.as class for the standard way of

> >dragging things in Flex. Don't use startDrag() and stopDrag().
> >
> >You will see addEventListener() to the systemManager and stage. in 
> >the sm.MOUSE_MOVE is where your actual instance logic goes.
> >
> >As far as your scroll bars question;
> >
> >Put the SWFLoader in a canvas and you should get the desired effect
as you 
> >pan.
> >
> >but... as I think about this more, there is something missing. Let
me know 
> >what this info does for you.
> >
> >Peace, Mike
> >
> >On 2/4/07, Mike Anderson <<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]> wrote:
> >
> >Hello All,
> >
> >I have a Box Component, that contains a SWFLoader.
> >
> >When the SWFLoader's Content grows beyond the bounds of the Box 
> >Container, I have the Scrollbars automatically appear.
> >
> >This particular content that the SWFLoader houses, is always going
to be
> >a Map. Obviously, when viewing Maps, Panning and Zooming are 
> >commonplace - and I want to provide the users the ability to drag the

> >Map Content around within the Box Component.
> >
> >Since I come from the Flash World, startDrag() and stopDrag() are 
> >very familiar commands to me, and of course those were the first 
> >Methods
that
> >came to mind, when making my Maps drag-able within my Flex App.
> >
> >Is startDrag() and stopDrag() still the preferred methods of moving 
> >content around on the screen, when it comes to Flex Apps?
> >
> >Now, I know there is the DragManager.as Class that comes bundled with

> >Flex - but isn't that more for the purpose of Dragging one 
> >Component's Content, into another one? And then keeping track of any 
> >Data that should get sent along, whenever the Drop Event takes place?
> >
> >In this particular case, I just want to be able to Pan the Maps
around.
> >
> >Will startDrag() and stopDrag() suffice in this instance?
> >
> >Also, is there a way where the Scrollbars on the Box Container, can 
> >sense the Content is being moved around, and to update the Scrollbar 
> >positions accordingly?
> >
> >How would I go about doing something like that?
> >
> >Thanks in advance, for any help you can offer.
> >
> >Mike
> >
> >
> >
> >
> >--
> >Teoti Graphix
> ><http://www.teotigraphix.com>http://www.teotigraphix.com
> >
> >Blog - Flex2Components
> ><http://www.flex2components.com>http://www.flex2components.com
> >
> >You can find more by solving the problem then by 'asking the
question'.
> >
> 
> Jeff Tapper
> Founding Partner
> Tapper, Nimer and Associates Inc.
> [EMAIL PROTECTED]
> (718) 576-1775
>




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links



Reply via email to