Packagestarling.events
Classpublic class TouchData
InheritanceTouchData Inheritance Object

Stores the information about raw touches in a pool of object instances.

This class is purely for internal use of the TouchProcessor.



Public Properties
 PropertyDefined By
  globalX : Number
[read-only] The x-position of the touch in stage coordinates.
TouchData
  globalY : Number
[read-only] The y-position of the touch in stage coordinates.
TouchData
  height : Number
[read-only] Height of the contact area.
TouchData
  id : int
[read-only] The identifier of a touch.
TouchData
  phase : String
[read-only] The current phase the touch is in.
TouchData
  pressure : Number
[read-only] A value between 0.0 and 1.0 indicating force of the contact with the device.
TouchData
  width : Number
[read-only] Width of the contact area.
TouchData
Public Methods
 MethodDefined By
  
fromPool(touchID:int, phase:String, globalX:Number, globalY:Number, pressure:Number = 1.0, width:Number = 1.0, height:Number = 1.0):TouchData
[static] Creates a new TouchData instance with the given properties or returns one from the object pool.
TouchData
  
toPool(rawTouch:TouchData):void
[static] Moves an instance back into the pool.
TouchData
Property Detail
globalXproperty
globalX:Number  [read-only]

The x-position of the touch in stage coordinates.


Implementation
    public function get globalX():Number
globalYproperty 
globalY:Number  [read-only]

The y-position of the touch in stage coordinates.


Implementation
    public function get globalY():Number
heightproperty 
height:Number  [read-only]

Height of the contact area. If the device does not support detecting the pressure, the value is 1.0.


Implementation
    public function get height():Number
idproperty 
id:int  [read-only]

The identifier of a touch. '0' for mouse events, an increasing number for touches.


Implementation
    public function get id():int
phaseproperty 
phase:String  [read-only]

The current phase the touch is in.


Implementation
    public function get phase():String

See also

pressureproperty 
pressure:Number  [read-only]

A value between 0.0 and 1.0 indicating force of the contact with the device. If the device does not support detecting the pressure, the value is 1.0.


Implementation
    public function get pressure():Number
widthproperty 
width:Number  [read-only]

Width of the contact area. If the device does not support detecting the pressure, the value is 1.0.


Implementation
    public function get width():Number
Method Detail
fromPool()method
public static function fromPool(touchID:int, phase:String, globalX:Number, globalY:Number, pressure:Number = 1.0, width:Number = 1.0, height:Number = 1.0):TouchData

Creates a new TouchData instance with the given properties or returns one from the object pool.

Parameters

touchID:int
 
phase:String
 
globalX:Number
 
globalY:Number
 
pressure:Number (default = 1.0)
 
width:Number (default = 1.0)
 
height:Number (default = 1.0)

Returns
TouchData
toPool()method 
public static function toPool(rawTouch:TouchData):void

Moves an instance back into the pool.

Parameters

rawTouch:TouchData