Doug, you're a store (and distribution point) of much useful Flex kung-fu :)
I didn't think of doing that last time I was messing with drag-n-drop, but it's a great idea. On Wed, Sep 24, 2008 at 6:02 AM, Doug McCune <[EMAIL PROTECTED]> wrote: > For basic dragging stuff, here's typically what I do. Have a mouse > down listener on whatever component you want to drag. On mouse down > you keep track of the coordinates where the user pressed. Then you add > a mouse move listener to the system manager. Also add a mouse up > listener to system manager. Then when the user moves the mouse (which > you catch with the system manager listener), perform the calculation > of how far from the original mouse down position the mouse is and move > the component to the right place. Then when you catch the mouse up > event (again, from system manager), you remove the mouse move listener > and you're done. > > See the code in the Panel class in the Flex framework for an example > of this type of dragging. The big thing to know is that you want to > use mouse move and mouse up events from the system manager, not from > the component itself. If you use the component itself you'll end up > losing the mouse movement if the user drags quickly off the component, > or you might get stuck in endless dragging if the mouse is released > while not over the component. > > You should also probably have a listener for when the mouse leaves the > stage and stop dragging at that point too, since not doing that can > make the drag operation continue after the release the mouse (if they > move the mouse off your app and the release). > > Doug > > On Tue, Sep 23, 2008 at 12:30 PM, gwangdesign <[EMAIL PROTECTED]> > wrote: > > Sorry if this question should be better showing up at the > > flexcomponent group. I didn't have any luck there so far;) > > > > Suppose I am motivated enough to roll up my sleeves to do something > > like what McCune is doing here at tileUI.com: > > > > http://www.youtube.com/watch?v=T0N7tgF7OOM > > > > Just for the drag part to get started, am I better off implementing > > the darg-drop framework that Flex provide or should I start from the > > more basic mouseUp/mouseDown? > > > > I guess this question is for every Flex guru besides Doug;) I > > appreciate it. > > > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." http://flex.joshmcdonald.info/ :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]

