views:

75

answers:

2

Hi,

I'm trying to implement a dragging system which can only be described as similar to dragging the map on Google Maps. I can set up dragging easily in Flex, but unfortunately the standard model of dragging i.e. dragging an element proxy and dropping it in another element is not what I'm after.

Is there anything built into flex where the actual element rather than a proxy can be repositioned in a different place within the same parent? Or will I have to hand code something using mouse events as you would if implementing a solution in JavaScript?

Cheers,

Chris

+1  A: 

DragManager and its associated constructs are specifically for dragging and dropping. You will likely want to place your draggable item inside of a canvas with scroll policies turned off, and capture MOUSE_DOWN on the object, then activate MOUSE_MOVE, translating its origin analogous to the change in mouse position, deactivating the MOUSE_MOVE listener when MOUSE_UP or Event.MOUSE_LEAVE fires on the stage.

Tegeril
If I'm capturing mouse up/move/down myself and adjusting the x/y of the item, then is there any benefit to using DragManager?
ChrisInCambo
I only mentioned DragManager to explain that it cannot do what you want, so no, I wouldn't :)
Tegeril
+1  A: 

Ok found a much more simple solution! Most elements have a dragStart and dragStop method which can be attached to the mouse down/up events.

ChrisInCambo
Ha, forgot about those.
Tegeril