| Package | org.aswing.dnd |
| Class | public class DragManager |
Thanks Bill Lee for the original DnD implementation for AsWing AS2 version.
| Property | Defined by | ||
|---|---|---|---|
| DEFAULT_DROP_MOTION : DropMotion
[static]
| DragManager | ||
| DEFAULT_REJECT_DROP_MOTION : DropMotion
[static]
| DragManager | ||
| TYPE_COPY : Number = 2 [static]
| DragManager | ||
| TYPE_MOVE : Number = 1 [static]
| DragManager | ||
| TYPE_NONE : Number = 0 [static]
| DragManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
addDragListener(lis:DragListener):void
[static]
Adds a drag listener to listener list.
| DragManager | ||
|
[static]
Returns the drag image.
| DragManager | ||
|
getCurrentDropTarget():DisplayObject
[static]
Returns current drop target of dragging components by startDrag method.
| DragManager | ||
|
[static]
Returns current drop target component of dragging components by startDrag method.
| DragManager | ||
|
[static]
Returns current drop target drop trigger component of dragging components by startDrag method.
| DragManager | ||
|
getDropTarget(stage:Stage, pos:Point = null, targetType:Class = null, addtionCheck:Function = null):DisplayObject
[static]
Returns the drop target of specified position and specified class type.
| DragManager | ||
|
getDropTargetComponent(pos:Point = null):Component
[static]
Returns current drop target component of specified position.
| DragManager | ||
|
getDropTragetDropTriggerComponent(pos:Point = null):Component
[static]
Returns drop target drop trigger component of specified global position.
| DragManager | ||
|
removeDragListener(lis:DragListener):void
[static]
Removes the specified listener from listener list.
| DragManager | ||
|
setDragingImageContainerRoot(theRoot:DisplayObjectContainer):void
[static]
Sets the container to hold the draging image(in fact it will hold the image's parent--a sprite).
| DragManager | ||
|
setDropMotion(motion:DropMotion):void
[static]
Sets the motion of drag movie clip when a drop acted.
| DragManager | ||
|
startDrag(dragInitiator:Component, sourceData:SourceData, dragImage:DraggingImage = null, dragListener:DragListener = null):void
[static]
startDrag(dragInitiator:Component, dragSource, dragImage:MovieClip, lis:DragListener)
startDrag(dragInitiator:Component, dragSource, dragImage:MovieClip) startDrag(dragInitiator:Component, dragSource) Starts dragging a initiator, with dragSource, a dragging Image, and a listener. | DragManager | ||
| DEFAULT_DROP_MOTION | property |
public static var DEFAULT_DROP_MOTION:DropMotion
| DEFAULT_REJECT_DROP_MOTION | property |
public static var DEFAULT_REJECT_DROP_MOTION:DropMotion
| TYPE_COPY | property |
public static var TYPE_COPY:Number = 2
| TYPE_MOVE | property |
public static var TYPE_MOVE:Number = 1
| TYPE_NONE | property |
public static var TYPE_NONE:Number = 0
| addDragListener | () | method |
public static function addDragListener(lis:DragListener):voidAdds a drag listener to listener list.
Parameterslis:DragListener — the listener to be add
|
| getCurrentDragImage | () | method |
public static function getCurrentDragImage():DraggingImageReturns the drag image.
ReturnsDraggingImage |
| getCurrentDropTarget | () | method |
public static function getCurrentDropTarget():DisplayObjectReturns current drop target of dragging components by startDrag method.
ReturnsDisplayObject — the drop target
|
See also
| getCurrentDropTargetComponent | () | method |
public static function getCurrentDropTargetComponent():ComponentReturns current drop target component of dragging components by startDrag method.
ReturnsComponent —
the drop target component
|
See also
| getCurrentDropTargetDropTriggerComponent | () | method |
public static function getCurrentDropTargetDropTriggerComponent():ComponentReturns current drop target drop trigger component of dragging components by startDrag method.
ReturnsComponent —
the drop target drop trigger component
|
See also
| getDropTarget | () | method |
public static function getDropTarget(stage:Stage, pos:Point = null, targetType:Class = null, addtionCheck:Function = null):DisplayObject
Returns the drop target of specified position and specified class type.
For example:
getDropTarget(new Point(0, 0), TextField); will return the first textfield insance under the point, or null if not found. getDropTarget(null, null); will return the first display object insance under the current mouse point, or null if not found.Parameters
stage:Stage — the stage where the drop target should be in
|
|
pos:Point (default = null) — The point under which to look, in the coordinate space of the Stage.
|
|
targetType:Class (default = null) — the class type of the target, default is null, means any display object.
|
|
addtionCheck:Function (default = null) — a check function, only return the target when function(target:DisplayOject) return true.
default is null, means no this check.
|
DisplayObject — drop target
|
| getDropTargetComponent | () | method |
public static function getDropTargetComponent(pos:Point = null):ComponentReturns current drop target component of specified position.
Parameterspos:Point (default = null) — the global point
|
Component —
the drop target component
|
See also
| getDropTragetDropTriggerComponent | () | method |
public static function getDropTragetDropTriggerComponent(pos:Point = null):ComponentReturns drop target drop trigger component of specified global position.
Parameterspos:Point (default = null) — the point
|
Component —
the drop target drop trigger component
|
See also
| removeDragListener | () | method |
public static function removeDragListener(lis:DragListener):voidRemoves the specified listener from listener list.
Parameterslis:DragListener — the listener to be removed
|
| setDragingImageContainerRoot | () | method |
public static function setDragingImageContainerRoot(theRoot:DisplayObjectContainer):void
Sets the container to hold the draging image(in fact it will hold the image's parent--a sprite).
By default(if you have not set one), it will be the AsWingManager.getRoot() value.
theRoot:DisplayObjectContainer — the container to hold the draging image.
|
See also
| setDropMotion | () | method |
public static function setDropMotion(motion:DropMotion):voidSets the motion of drag movie clip when a drop acted.
Generally if you want to do a custom motion of the dragging movie clip when dropped, you may
call this method in the listener's onDragDrop() method.
Every drop acted, the default motion will be set to DirectlyRemoveMotion
so you need to set to yours every drop time if you want.
Parameters
motion:DropMotion — the motion
|
See also
| startDrag | () | method |
public static function startDrag(dragInitiator:Component, sourceData:SourceData, dragImage:DraggingImage = null, dragListener:DragListener = null):void
startDrag(dragInitiator:Component, dragSource, dragImage:MovieClip, lis:DragListener)
startDrag(dragInitiator:Component, dragSource, dragImage:MovieClip)
startDrag(dragInitiator:Component, dragSource)
Starts dragging a initiator, with dragSource, a dragging Image, and a listener. The drag action will be finished at next Mouse UP/Down Event(Mouse UP or Mouse Down, generally you start a drag when mouse down, then it will be finished when mouse up, if you start a drag when mouse up, it will be finished when mouse down). Parameters
dragInitiator:Component — the dragging initiator
|
|
sourceData:SourceData — the data source will pass to the listeners and target components
|
|
dragImage:DraggingImage (default = null) — (optional)the image to drag, default is a rectangle image.
|
|
dragListener:DragListener (default = null) — (optional)the listener added to just for this time dragging action, default is null(no listener)
|