About the Drag and Drop Manager

Visual development environments typically let you manipulate objects in an application by selecting them with a mouse and moving them around the screen. The Flex Drag and Drop Manager lets you select an object, such as an item in a List control, or a Flex control, such as an Image control, and then drag it over another component to add it to that component.

All Flex components support the drag-and-drop operation. Flex also includes specific additional support for the drag-and-drop operation for certain controls, such as List, Tree, and DataGrid.

Subtopics

About the drag-and-drop operation

About the drag-and-drop operation

The drag-and-drop operation has three main stages: initiation, dragging, and dropping. The following paragraphs describe these stages from a broad perspective. Later sections describe the stages in greater detail.

Initiation A user initiates a drag-and-drop operation by using the mouse to select a Flex component, or an item in a Flex component, and then moving the component or item while holding down the mouse button. For example, a user selects an item in a List control with the mouse and, while holding down the mouse button, moves the mouse several pixels. The selected component is the drag initiator.

Dragging While holding down the mouse button, the user moves the mouse around the Flex application. Flex displays an image during the drag, which is the drag proxy. The drag source (a DragSource object) contains the data being dragged.

Dropping When the user moves the drag proxy over another Flex component, that component becomes a possible drop target. The drop target can inspect the drag source to determine whether the data is in a format that the target accepts and, if so, let the user drop the data onto it. If the drop target determines that the data is not in an acceptable format, the drop target can disallow the drop operation.

Upon a successful drop operation, Flex adds the data to the target and, optionally, deletes it from its original location.


Flex 2

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flex/2/docs/00000955.html