I was trying to implement drag and drop for a loaded Image today. All I needed to do was move it, and constrain the drag to the parent container, and that’s it. In two different books I have on flex, and in the documentation, as well as this tutorial, they talk about implementing drag and drap through a series of steps which include:

  • importing the DragManager, Drag Source, and Drag Event classes
  • Creating a new DragSource object
  • Creating a new proxy image, which is the item that is visibly being dragged
  • Setting up another object oto act as as a drop target and handle drag events

After getting 90% complete with that method, I ran across a comment on the Flex LiveDocs which pointed me to the blatantly obvious: you can simply use the startDrag() and stopDrag() methods inherited Sprite.

Durr.