The GestureController.as script will help you detect gestures. You can use it to detect mouse gestures or to detect gestures in mobile devices. These gestures are one finger movement only.
How to use GestureController.as
Create an instance wherever you want in order to use it. If you want to start detecting input you will have to turn it on calling the turnOn function. Once you finish recording just call the turnOff function.
Then, if you want to check the values you got just read the public var called movementList.
Public Functions
- turnOn():void
- turnOff():void
Public Vars
- drawing:Boolean
- px:int
- py:int
- px2:int
- py2:int
- lastDirection:Number
- currentDirection:Number=-1
- movementList:Vector.<String> = new Vector.<String>
- oldMovementList:Vector.<String>
- changeMovementList:Vector.<String> = new Vector.<String>
- oldChangeMovementList:Vector.<String>
Private Functions
- evUpdate():void
- addToChangeMovement(direction:String):void
- detectMovement(e:MouseEvent):void
- stopDetectingMovement(e:MouseEvent):void