패키지 | mx.managers |
클래스 | public class DragManager |
상속 | DragManager Object |
언어 버전: | ActionScript 3.0 |
제품 버전: | Flex 3 |
런타임 버전: | 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.
기타 예제
Dragging and dropping in multi-versioned applications
The drag-and-drop operation
관련 API 요소
속성 | 정의 주체 | ||
---|---|---|---|
constructor : 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 | ||
지정된 속성이 객체에 정의되어 있는지 여부를 나타냅니다. | Object | ||
Object 클래스의 인스턴스가 매개 변수로 지정된 객체의 프로토타입 체인에 있는지 여부를 나타냅니다. | Object | ||
지정된 속성이 존재하고 열거 가능한지 여부를 나타냅니다. | Object | ||
루프 작업에서 동적 속성을 사용할 수 있는지 여부를 설정합니다. | Object | ||
[정적]
Sets the feedback indicator for the drag and drop operation. | DragManager | ||
로캘별 규칙에 따라 서식이 지정된 이 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 문자열 표현을 반환합니다. | Object | ||
지정된 객체의 프리미티브 값을 반환합니다. | 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 | 속성 |
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 | () | 메서드 |
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".
Tue Jun 12 2018, 03:17 PM Z