Packagefeathers.dragDrop
Classpublic class DragDropManager
InheritanceDragDropManager Inheritance Object

Product Version : Feathers 1.0.0

Handles drag and drop operations based on Starling touch events.

See also

feathers.dragDrop.IDragSource
feathers.dragDrop.IDropTarget
feathers.dragDrop.DragData


Public Properties
 PropertyDefined By
  dragData : DragData
[static] [read-only] The data associated with the current drag.
DragDropManager
  dragSource : IDragSource
[static] [read-only] The IDragSource that started the current drag.
DragDropManager
  isDragging : Boolean
[static] [read-only] Determines if the drag and drop manager is currently handling a drag.
DragDropManager
  touchPointID : int
[static] [read-only] The ID of the touch that initiated the current drag.
DragDropManager
Public Methods
 MethodDefined By
  
acceptDrag(target:IDropTarget):void
[static] Tells the drag and drop manager if the target will accept the current drop.
DragDropManager
  
cancelDrag():void
[static] Immediately cancels the current drag.
DragDropManager
  
startDrag(source:IDragSource, touch:Touch, data:DragData, dragAvatar:DisplayObject = null, dragAvatarOffsetX:Number = 0, dragAvatarOffsetY:Number = 0):void
[static] Starts a new drag.
DragDropManager
Property Detail
dragDataproperty
dragData:DragData  [read-only]

The data associated with the current drag. Returns null if there is not a current drag.


Implementation
    public static function get dragData():DragData
dragSourceproperty 
dragSource:IDragSource  [read-only]

The IDragSource that started the current drag.


Implementation
    public static function get dragSource():IDragSource
isDraggingproperty 
isDragging:Boolean  [read-only]

Determines if the drag and drop manager is currently handling a drag. Only one drag may be active at a time.


Implementation
    public static function get isDragging():Boolean
touchPointIDproperty 
touchPointID:int  [read-only]

The ID of the touch that initiated the current drag. Returns -1 if there is not an active drag action. In multi-touch applications, knowing the touch ID is useful if additional actions need to happen using the same touch.


Implementation
    public static function get touchPointID():int
Method Detail
acceptDrag()method
public static function acceptDrag(target:IDropTarget):void

Tells the drag and drop manager if the target will accept the current drop. Meant to be called in a listener for the target's DragDropEvent.DRAG_ENTER event.

Parameters

target:IDropTarget

cancelDrag()method 
public static function cancelDrag():void

Immediately cancels the current drag.

startDrag()method 
public static function startDrag(source:IDragSource, touch:Touch, data:DragData, dragAvatar:DisplayObject = null, dragAvatarOffsetX:Number = 0, dragAvatarOffsetY:Number = 0):void

Starts a new drag. If another drag is currently active, it is immediately cancelled. Includes an optional "avatar", a visual representation of the data that is being dragged.

Parameters

source:IDragSource
 
touch:Touch
 
data:DragData
 
dragAvatar:DisplayObject (default = null)
 
dragAvatarOffsetX:Number (default = 0)
 
dragAvatarOffsetY:Number (default = 0)