This chapter examines the capabilities in the Flex framework for dragging and dropping entities from one area of an application to another. The items covered are as follows:
Working with the drag and drop-enabled components
Working with drag and drop events
Adding drag and drop to nonenabled components
Additional drag and drop tips
Dragging and dropping is a very natural way for a user to interact with a modern graphical user interface. Drag and drop support is built into modern operating systems such as Windows and Mac OS. Some of the use cases that come to mind when talking about drag and drop in a modern operating system include:
Dragging an item such as an audio file, image, or video file onto a player or viewer.
Relocating an item between two different item groups. For instance, you might use classroom management software to drag and drop a student record from one classroom roster to another.
Deleting an item by dragging it onto a trash can icon.
Rearranging your UI preferences by dragging and dropping around the various display components.
As you can see, dragging and dropping is something that is used very extensively these days, and luckily, drag and drop was factored into the Flex framework. Let's start by taking a look at the components that natively support drag and drop.
Fortunately for you as a Flex developer, there are a number of components that support drag and drop right out of the box. ...