Packagepq.multitouch
Classpublic class MultiTouch

The MultiTouch class contains global controls of multi-touch lib.



Public Methods
 MethodDefined by
  
init(appContainer:DisplayObjectContainer,connectFailCallBack:Function=null):void
[static] Connect to Multi-Touch Server and initialize.
MultiTouch
  
enableGesture(obj:DisplayObject,gesture:BaseGesture, listener:Function=null,isStopPropagation:Boolean=true):BaseGesture
[static] Registers a gesture event listener object with a DisplayObject instance so that the DisplayObject instance can receive notification of a certain gesture event.
MultiTouch
  
enableMouseSimulation(obj:DisplayObject,isStopPropagation:Boolean=true):BaseGesture
[static] Registers a MouseSimulation gesture instance with a DisplayObject instance specifically.
MultiTouch
  
disableGesture(gesture:BaseGesture):void
[static] Removes a touch gesture.
MultiTouch
  
disableAllGesture(obj:DisplayObject):void
[static] Removes all touch gestures that are registered to a certain display object.
MultiTouch
  
getBlob(touchID:int):Blob
[static] Get the instance of the global touch blob through touchID.
MultiTouch
  
getRelatedBlobs(obj:DisplayObject):Array
[static] Get the collection of the global touch blobs which are captured by obj.
MultiTouch
  
[static] Get the collection of the global touch blobs on the stage.
MultiTouch
Method detail
init () method  
public static function init(appContainer:DisplayObjectContainer,connectFailCallBack:Function=null,connectedCallBack:Function=null):void

Connect to Multi-Touch Server and initialize.

Parameters

appContainer:DisplayObjectContainer — A DisplayObectContainer instance. In Flex, it should be the instance of mx.core.Application(RIA) or mx.core.WindowedApplication(AIR);In flash, it should be the reference of stage.

connectFailCallBack:Function — Callback function when multi-touch lib fail to connect with Multi-Touch Server.

enableGesture()method 
public static function enableGesture(obj:DisplayObject,gesture:BaseGesture,
listener:Function=null,isStopPropagation:Boolean=true):BaseGesture

Registers a gesture event listener object with a DisplayObject instance so that the DisplayObject instance can receive notification of a certain gesture event. if listener==null, gesture must be a manipulator, like DragScaleRotate, which handles all gesture function internally. By default, isStopPropagation==true, and the display object will call e.isStopPropagation() after handling with the TouchDown, TouchMove, TouchUp event, otherwise, the TouchDown, TouchMove, TouchUp event will bubble up to the parent of the display object instance.

Parameters
obj:DisplayObject — A DisplayObject instance,touch event listener object.
 
gesture:BaseGesture — Touch gesture instance which handles with basic touch events the display object received.
 
listener:Function(default = null) — The listener function that processes the gesture event,if listener==null, gesture must be a manipulator, like DragScaleRotate, which handles all gesture function internally.
 
isStopPropagation:Boolean(default = true) — By default, isStopPropagation==true, and the display object will call e.isStopPropagation() after handling with the TouchDown, TouchMove, TouchUp event, otherwise, the TouchDown, TouchMove, TouchUp event will bubble up to the parent of the display object instance.

Returns
BaseGesture — Touch gesture instance.
enableMouseSimulation()method 
public static function enableMouseSimulation(obj:DisplayObject,isStopPropagation:Boolean=true):BaseGesture

Registers a MouseSimulation gesture instance with a DisplayObject instance specifically.

Parameters
obj:DisplayObject — A DisplayObject instance.
 
isStopPropagation:Boolean(default = true) — By default, isStopPropagation==true, and the display object will call e.isStopPropagation() after handling with the TouchDown, TouchMove, TouchUp event, otherwise, the TouchDown, TouchMove, TouchUp event will bubble up to the parent of the display object instance.

Returns
BaseGesture — MouseSimulation gesture instance.
disableGesture()method 
public static function disableGesture(gesture:BaseGesture):void

Removes a touch gesture.

Parameters
gesture:BaseGesture — Touch gesture instance which handles with basic touch events.
disableAllGesture()method 
public static function disableAllGesture(obj:DisplayObject):void

Removes all touch gestures that are registered to a certain display object.

Parameters
obj:DisplayObject — A DisplayObject instance.
getBlob()method 
public static function getBlob(touchID:int):Blob

Get the instance of the global touch blob through touchID.

Parameters
touchID:int — int value indicates id of the touch blob.

Returns
Blob — A Blob instance.
getRelatedBlobs()method 
public static function getRelatedBlobs(obj:DisplayObject):Array

Get the collection of the global touch blobs which are captured by obj.

Parameters
obj:DisplayObject — DisplayObject instance.

Returns
Array — collection of the touch blobs.
getGlobalBlobs()method 
public static function getGlobalBlobs():Array

Get the collection of the global touch blobs on the stage.

Returns
Array — collection of the touch blobs.