適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: 從伺服器擷取資料...
從伺服器擷取資料...
mx.managers 

DragManager  - AS3 Flex

套件mx.managers
類別public class DragManager
繼承DragManager Inheritance Object

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

The DragManager class manages drag and drop operations, which let you move data from one place to another in a Flex application. For example, you can 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 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.

更多範例

相關 API 元素



公用屬性
 屬性定義自
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  isDragging : Boolean
[靜態] [唯讀] Read-only property that returns true if a drag is in progress.
DragManager
公用方法
 方法定義自
  
[靜態] 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
[靜態] Initiates a drag and drop operation.
DragManager
  
[靜態] Returns the current drag and drop feedback.
DragManager
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
  
[靜態] Sets the feedback indicator for the drag and drop operation.
DragManager
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
樣式

樣式可分為一般樣式及與特定主題關聯的樣式兩種。如果是一般樣式,可以與任何主題搭配使用。如果是與特定主題關聯的樣式,只有在您的應用程式使用特定主題時才能使用該樣式。

一般樣式
 樣式 說明 定義自
  
copyCursor
類型: Class CSS 繼承:
語言版本: ActionScript 3.0  產品版本: Flex 3  執行階段版本: 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
類型: Class CSS 繼承:
語言版本: ActionScript 3.0  產品版本: Flex 3  執行階段版本: Flash9, AIR 1.1

Skin used to draw the default drag image, which is also called the drag proxy. 預設值為 mx.skins.halo.DefaultDragImage (for both Halo and Spark themes)
DragManager
  
linkCursor
類型: Class CSS 繼承:
語言版本: ActionScript 3.0  產品版本: Flex 3  執行階段版本: 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
類型: Class CSS 繼承:
語言版本: ActionScript 3.0  產品版本: Flex 3  執行階段版本: 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
類型: Class CSS 繼承:
語言版本: ActionScript 3.0  產品版本: Flex 3  執行階段版本: 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
公用常數
 常數定義自
  COPY : String = "copy"
[靜態] Constant that specifies that the type of drag action is "copy".
DragManager
  LINK : String = "link"
[靜態] Constant that specifies that the type of drag action is "link".
DragManager
  MOVE : String = "move"
[靜態] Constant that specifies that the type of drag action is "move".
DragManager
  NONE : String = "none"
[靜態] Constant that specifies that the type of drag action is "none".
DragManager
屬性詳細資訊

isDragging

屬性
isDragging:Boolean  [唯讀]

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Read-only property that returns true if a drag is in progress.



實作
    public static function get isDragging():Boolean
方法詳細資訊

acceptDragDrop

()方法
public static function acceptDragDrop(target:IUIComponent):void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: 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));

參數

target:IUIComponent — The drop target accepting the drag.

doDrag

()方法 
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

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Initiates a drag and drop operation.

參數

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

()方法 
public static function getFeedback():String

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Returns the current drag and drop feedback.

傳回值
String — Possible return values are DragManager.COPY, DragManager.MOVE, DragManager.LINK, or DragManager.NONE.

showFeedback

()方法 
public static function showFeedback(feedback:String):void

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: 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.

參數

feedback:String — The type of feedback indicator to display.

常數詳細資訊

COPY

常數
public static const COPY:String = "copy"

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constant that specifies that the type of drag action is "copy".

LINK

常數 
public static const LINK:String = "link"

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constant that specifies that the type of drag action is "link".

MOVE

常數 
public static const MOVE:String = "move"

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constant that specifies that the type of drag action is "move".

NONE

常數 
public static const NONE:String = "none"

語言版本: ActionScript 3.0
產品版本: Flex 3
執行階段版本: Flash Player 9, AIR 1.1

Constant that specifies that the type of drag action is "none".





[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。