Access keys

DragButton

Kind of class: class
Inherits from: EventMovieClip < MovieClip
Known subclasses:
Author: Martijn de Visser, Arthur Clemens (refactoring)
Classpath: org.asapframework.ui.buttons.DragButton
File last modified: Sunday, 08 October 2006, 23:32:32
A button that can be dragged around.

Assumes the presence of the following frame labels to represent states:
  • 'normal'
  • 'rollover'
  • 'mousedown'
Events broadcast to listeners:
DragButtonEvent with type: ON_MOVE - if sendMoveEvent == true
DragButtonEvent with type: ON_START
DragButtonEvent with type: ON_END

Constructor

DragButton

function DragButton (
)

Instance properties

distance

distance:Point
(read)

sendMoveEvent

sendMoveEvent
(write)
Set to true to receive move events (may be CPU intensive, false by default)

Instance methods

getBounds

function getBounds (
Returns:
The bounding rectangle (in pixels) in which the MovieClip may move.

setBounds

function setBounds (
inBounds:Rectangle) : Void
Sets the bounding rectangle (in pixels) in which the MovieClip may move. Pass a Rectangle with a height of 1 to create a horizontal-only draggable clip.
Parameters:
inBounds:
the constraining rectangle in pixels

Event handlers

onClipDragging

function onClipDragging (
) : Void
Override in subclasses; if you need actions to be taken when the clip is being dragged, implement additional functionality in an overriding method. Performance may be a point as this function is called while the clip moves on each onEnterFrame event.

onDragEnd

function onDragEnd (
) : Void
Events broadcast to listeners:
DragButtonEvent with type: ON_END

onMouseUp

function onMouseUp (
) : Void

onPress

function onPress (
) : Void
Events broadcast to listeners:
DragButtonEvent with type: ON_START

onRelease

function onRelease (
) : Void

onReleaseOutside

function onReleaseOutside (
) : Void

onRollOut

function onRollOut (
) : Void

onRollOver

function onRollOver (
) : Void