API Documentation for: 0.6.0
Show:

Touch Class

Defined in: Touch:36
Module: EaselJS

Global utility for working with multi-touch enabled devices in EaselJS. Currently supports W3C Touch API (iOS and modern Android browser) and IE10.

Ensure that you disable touch when cleaning up your application. Note that you do not have to check if touch is supported to enable it, as it will fail gracefully if it is not supported.

Example

 var stage = new createjs.Stage("canvas");
 createjs.Touch.enable(stage);

Methods

_handleEnd

() protected

Defined in _handleEnd:246

_handleMove

() protected

Defined in _handleMove:237

_handleStart

() protected

Defined in _handleStart:223

_IE_enable

(
  • stage
)
protected static

Defined in _IE_enable:180

Parameters:

_IE_enable

(
  • stage
)
protected static

Defined in _IE_enable:163

Parameters:

_IE_handleEvent

() protected static

Defined in _IE_handleEvent:196

_IOS_disable

(
  • stage
)
protected static

Defined in _IOS_disable:122

Parameters:

_IOS_enable

(
  • stage
)
protected static

Defined in _IOS_enable:107

Parameters:

_IOS_handleEvent

() protected static

disable

(
  • stage
)
static

Defined in disable:93

Removes all listeners that were set up when calling Touch.enable on a stage.

Parameters:

  • stage Stage

    The stage to disable touch on.

enable

(
  • stage
  • [singleTouch=false]
  • [allowDefault=false]
)
Boolean static

Defined in enable:67

Enables touch interaction for the specified EaselJS stage. Currently supports iOS (and compatible browsers, such as modern Android browsers), and IE10. Supports both single touch and multi-touch modes. Extends the EaselJS MouseEvent model, but without support for double click or over/out events. See MouseEvent.pointerID for more information.

Parameters:

  • stage Stage

    The stage to enable touch on.

  • [singleTouch=false] Boolean optional

    If true, only a single touch will be active at a time.

  • [allowDefault=false] Boolean optional

    If true, then default gesture actions (ex. scrolling, zooming) will be allowed when the user is interacting with the target canvas.

Returns:

Boolean: Returns true if touch was successfully enabled on the target stage.

handleEvent

() protected

Defined in handleEvent:171

initialize

() protected

Defined in initialize:117

Initialization method.

isSupported

() Boolean static

Defined in isSupported:56

Returns true if touch is supported in the current browser.

Returns:

Boolean: Indicates whether touch is supported in the current browser.

setEnabled

(
  • value
)

Defined in setEnabled:142

Enables or disables the button functionality on the target.

Parameters:

toString

() String

Defined in toString:160

Returns a string representation of this object.

Returns:

String: a string representation of the instance.

Properties

_isPressed

Boolean protected

Defined in _isPressed:102

_isPressed

Boolean protected

Defined in _isPressed:109

downLabel

String | Number

Defined in downLabel:86

The label name or frame number to display when the user presses on the target. Defaults to "down".

outLabel

String | Number

Defined in outLabel:79

The label name or frame number to display when the user mouses over the target. Defaults to "out".

overLabel

String | Number

Defined in overLabel:72

The label name or frame number to display when the user mouses out of the target. Defaults to "over".

play

Boolean

Defined in play:93

If true, then ButtonHelper will call gotoAndPlay, if false, it will use gotoAndStop. Default is false.

Default: false

target

MovieClip | BitmapAnimation

Defined in target:65

Read-only. The target for this button helper.