Pacchetto | mx.managers |
Classe | public class DragManager |
Ereditarietà | DragManager Object |
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
All methods and properties of the DragManager are static, so you do not need to create an instance of it.
All Flex components support drag and drop operations. Flex provides additional support for drag and drop to the List, Tree, and DataGrid controls.
When the user selects an item with the mouse, the selected component is called the drag initiator. The image displayed during the drag operation is called the drag proxy.
When the user moves the drag proxy over another component,
the dragEnter
event is sent to that component.
If the component accepts the drag, it becomes the drop target
and receives dragOver
, dragExit
,
and dragDrop
events.
When the drag is complete, a dragComplete
event
is sent to the drag initiator.
Altri esempi
Dragging and dropping in multi-versioned applications
The drag-and-drop operation
Elementi API correlati
Proprietà | Definito da | ||
---|---|---|---|
constructor : Object
Un riferimento all'oggetto classe o alla funzione di costruzione per una determinata istanza di oggetto. | Object | ||
isDragging : Boolean [statico] [sola lettura]
Read-only property that returns true
if a drag is in progress. | DragManager |
Metodo | Definito da | ||
---|---|---|---|
[statico]
Call this method from your dragEnter event handler if you accept
the drag/drop data. | DragManager | ||
doDrag(dragInitiator:IUIComponent, dragSource:DragSource, mouseEvent:MouseEvent, dragImage:IFlexDisplayObject = null, xOffset:Number = 0, yOffset:Number = 0, imageAlpha:Number = 0.5, allowMove:Boolean = true):void [statico]
Initiates a drag and drop operation. | DragManager | ||
[statico]
Returns the current drag and drop feedback. | DragManager | ||
Indica se per un oggetto è definita una proprietà specifica. | Object | ||
Indica se un'istanza della classe Object si trova nella catena di prototipi dell'oggetto specificato come parametro. | Object | ||
Indica se la proprietà specificata esiste ed è enumerabile. | Object | ||
Imposta la disponibilità di una proprietà dinamica per le operazioni cicliche. | Object | ||
[statico]
Sets the feedback indicator for the drag and drop operation. | DragManager | ||
Restituisce la rappresentazione in formato stringa di questo oggetto, formattato in base alle convenzioni specifiche per le versioni localizzate. | Object | ||
Restituisce la rappresentazione in formato stringa dell'oggetto specificato. | Object | ||
Restituisce il valore di base dell'oggetto specificato. | Object |
Gli stili sono di tipo comune oppure associati a un tema specifico. Se lo stile è comune, può essere utilizzato con qualunque tema. Se è associato a un tema specifico, può essere utilizzato solo se la vostra applicazione ne fa uso.
Stile | Descrizione | Definito da | ||
---|---|---|---|---|
copyCursor | Tipo: Class Ereditarietà CSS: No Versione linguaggio: ActionScript 3.0 Versione prodotto: Flex 3 Versioni runtime: Flash9, AIR 1.1 Cursor displayed during a copy operation. The default value is the "mx.skins.cursor.DragCopy" symbol in the Assets.swf file. | DragManager | ||
defaultDragImageSkin | Tipo: Class Ereditarietà CSS: No Versione linguaggio: ActionScript 3.0 Versione prodotto: Flex 3 Versioni runtime: Flash9, AIR 1.1 Skin used to draw the default drag image, which is also called the drag proxy. Il valore predefinito è mx.skins.halo.DefaultDragImage (for both Halo and Spark themes) . | DragManager | ||
linkCursor | Tipo: Class Ereditarietà CSS: No Versione linguaggio: ActionScript 3.0 Versione prodotto: Flex 3 Versioni runtime: Flash9, AIR 1.1 Cursor displayed during a link operation. The default value is the "mx.skins.cursor.DragLink" symbol in the Assets.swf file. | DragManager | ||
moveCursor | Tipo: Class Ereditarietà CSS: No Versione linguaggio: ActionScript 3.0 Versione prodotto: Flex 3 Versioni runtime: Flash9, AIR 1.1 Cursor displayed during a move operation. The default value is the "mx.skins.cursor.DragMove" symbol in the Assets.swf file. | DragManager | ||
rejectCursor | Tipo: Class Ereditarietà CSS: No Versione linguaggio: ActionScript 3.0 Versione prodotto: Flex 3 Versioni runtime: Flash9, AIR 1.1 Cursor displayed for a reject operation. The default value is the "mx.skins.cursor.DragReject" symbol in the Assets.swf file. | DragManager |
Costante | Definito da | ||
---|---|---|---|
COPY : String = "copy" [statico]
Constant that specifies that the type of drag action is "copy". | DragManager | ||
LINK : String = "link" [statico]
Constant that specifies that the type of drag action is "link". | DragManager | ||
MOVE : String = "move" [statico]
Constant that specifies that the type of drag action is "move". | DragManager | ||
NONE : String = "none" [statico]
Constant that specifies that the type of drag action is "none". | DragManager |
isDragging | proprietà |
acceptDragDrop | () | metodo |
public static function acceptDragDrop(target:IUIComponent):void
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Call this method from your dragEnter
event handler if you accept
the drag/drop data.
Typically, you cast event.target
to the data type of the drop target.
In the following example, the drop target is an MX Canvas container:
DragManager.acceptDragDrop(Canvas(event.target));
Parametri
target:IUIComponent — The drop target accepting the drag.
|
doDrag | () | metodo |
public static function doDrag(dragInitiator:IUIComponent, dragSource:DragSource, mouseEvent:MouseEvent, dragImage:IFlexDisplayObject = null, xOffset:Number = 0, yOffset:Number = 0, imageAlpha:Number = 0.5, allowMove:Boolean = true):void
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Initiates a drag and drop operation.
Parametri
dragInitiator:IUIComponent — IUIComponent that specifies the component initiating
the drag.
| |
dragSource:DragSource — DragSource object that contains the data
being dragged.
| |
mouseEvent:MouseEvent — The MouseEvent that contains the mouse information
for the start of the drag.
| |
dragImage:IFlexDisplayObject (default = null ) — The image to drag. This argument is optional.
If omitted, a standard drag rectangle is used during the drag and
drop operation. If you specify an image, you must explicitly set a
height and width of the image or else it will not appear.
| |
xOffset:Number (default = 0 ) — Number that specifies the x offset, in pixels, for the
dragImage . This argument is optional. If omitted, the drag proxy
is shown at the upper-left corner of the drag initiator. The offset is expressed
in pixels from the left edge of the drag proxy to the left edge of the drag
initiator, and is usually a negative number.
| |
yOffset:Number (default = 0 ) — Number that specifies the y offset, in pixels, for the
dragImage . This argument is optional. If omitted, the drag proxy
is shown at the upper-left corner of the drag initiator. The offset is expressed
in pixels from the top edge of the drag proxy to the top edge of the drag
initiator, and is usually a negative number.
| |
imageAlpha:Number (default = 0.5 ) — Number that specifies the alpha value used for the
drag image. This argument is optional. If omitted, the default alpha
value is 0.5. A value of 0.0 indicates that the image is transparent;
a value of 1.0 indicates it is fully opaque.
| |
allowMove:Boolean (default = true ) — Indicates if a drop target is allowed to move the dragged data.
|
getFeedback | () | metodo |
public static function getFeedback():String
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Returns the current drag and drop feedback.
RestituisceString — Possible return values are DragManager.COPY ,
DragManager.MOVE ,
DragManager.LINK , or DragManager.NONE .
|
showFeedback | () | metodo |
public static function showFeedback(feedback:String):void
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Sets the feedback indicator for the drag and drop operation.
Possible values are DragManager.COPY
, DragManager.MOVE
,
DragManager.LINK
, or DragManager.NONE
.
Parametri
feedback:String — The type of feedback indicator to display.
|
COPY | Costante |
public static const COPY:String = "copy"
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Constant that specifies that the type of drag action is "copy".
LINK | Costante |
public static const LINK:String = "link"
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Constant that specifies that the type of drag action is "link".
MOVE | Costante |
public static const MOVE:String = "move"
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Constant that specifies that the type of drag action is "move".
NONE | Costante |
public static const NONE:String = "none"
Versione linguaggio: | ActionScript 3.0 |
Versione prodotto: | Flex 3 |
Versioni runtime: | Flash Player 9, AIR 1.1 |
Constant that specifies that the type of drag action is "none".
Tue Jun 12 2018, 02:44 PM Z