Packagecom.dipigraphics.fingersMotion
Classpublic class FingersMotionEvent
InheritanceFingersMotionEvent Inheritance flash.events.Event

This class provides the FingersMotion Event.

Created by Denis Pissoort

Produced by Haute Ecole Albert Jacquard

Email : denis@dipi-graphics.com

HomePage of the project : Fingers Motion Project HomePage

This software is licensed under the CC-GNU GPL version 2.0 or later.



Public Properties
 PropertyDefined By
  fmDataTransmitted : *
fmDataTransmitted is used only with the Rotation Event and give you the angle between Yellow and Green in degree.
FingersMotionEvent
Public Methods
 MethodDefined By
  
FingersMotionEvent(type:String, fmData:* = null, bubbles:Boolean = false, cancelable:Boolean = false)
This Method provide the Events to interact with your application as a navigation system.
FingersMotionEvent
Public Constants
 ConstantDefined By
  FM_ACTIVE : String = fmActive
[static] FM_ACTIVE This Event is never dispatch but you need to add it to activte the others.
FingersMotionEvent
  FM_CLICK : String = fmClick
[static] FM_CLICK represent the Fingers Motion Click Event
FingersMotionEvent
  FM_DRAG_AND_DROP : String = fmDragAndDrop
[static] FM_DRAG_AND_DROP represent the Fingers Motion Drag and Drop Event
FingersMotionEvent
  FM_HOVER : String = fmHover
[static] FM_HOVER represent the Fingers Motion Hover Event
FingersMotionEvent
  FM_OUT : String = fmOut
[static] FM_OUT represent the Fingers Motion Out Event
FingersMotionEvent
  FM_ROTATION : String = fmRotation
[static] FM_ROTATION represent the Fingers Motion Rotation Event
FingersMotionEvent
Property Detail
fmDataTransmittedproperty
public var fmDataTransmitted:*

fmDataTransmitted is used only with the Rotation Event and give you the angle between Yellow and Green in degree.

Constructor Detail
FingersMotionEvent()Constructor
public function FingersMotionEvent(type:String, fmData:* = null, bubbles:Boolean = false, cancelable:Boolean = false)

This Method provide the Events to interact with your application as a navigation system.

This is the list that represent the event you must have to activate the others.

So if there is no FM_HOVER on a Sprite, the FM_CLICK IS NEVER DISPATCH !! Be carefull

Parameters
type:String
 
fmData:* (default = null)
 
bubbles:Boolean (default = false)
 
cancelable:Boolean (default = false)

Example
Hover and Rotation Exemple <<How to use event in your application>> :
         //set a container for your application
         var MyApplicationContainer:Sprite = new Sprite(); 
         [...] // add you application in the container
         addChild(MyApplicationContainer);
         
         // create the fingers motion navigation
         var MyNavigation:fingersMotion = new fingersMotion(MyApplicationContainer,true,true);
         addChild(MyNavigation);
         
         //Creation of event 
         // Assuming that you have a sprite <mySprite> in MyApplicationContainer
         
         //Activate Event
         // Note : this event is never dispatch.
         mySprite.addEventListener(FingersMotionEvent.FM_ACTIVE, activateFingersMotion);
         //AddEventListener for hover. If you have no hover Event other Event can't launch.
         mySprite.addEventListener(FingersMotionEvent.FM_HOVER, doFingersMotionOver);
         
         //create the hover function 
         function doFingersMotionOver(e:FingersMotionEvent):void{
         trace(e.target); // OUTPUT your Sprite Object.
         }
         
         //AddEventListener for Drag and Drop. (this event its needed to allow fingersMotion to dispatch the Rotation Events see list above)
         mySprite.addEventListener(FingersMotionEvent.FM_DRAG_AND_DROP, doFingersMotionDragAndDrop);
         
         //create the Drag and Drop function 
         function doFingersMotionDragAndDrop(e:FingersMotionEvent):void{
         trace(e.target); // OUTPUT your Sprite Object.
         }
         
         
         //AddEventListener for rotation.
         mySprite.addEventListener(FingersMotionEvent.FM_ROTATION, doFingersMotionRotation);
         
         //create the rotation function 
         function doFingersMotionRotation(e:FingersMotionEvent):void{
         trace(e.target); // OUTPUT your Sprite Object.
         trace(e.fmDataTransmitted); // OUTPUT the angle to apply for the rotation
         e.target.rotation = e.fmDataTransmitted;
         } 
         
         

Here is the list that represents the actions sended :

  • yellow = normal mode : hover is dispatch when yellow is on a sprite.
  • yellow in hover mode + blue = Drag and Drop mode.
  • yellow in hover mode + green = click mode.
  • Drag an Drop mode + green = rotation mode with drag and drop.
Constant Detail
FM_ACTIVEConstant
public static const FM_ACTIVE:String = fmActive

FM_ACTIVE This Event is never dispatch but you need to add it to activte the others.

FM_CLICKConstant 
public static const FM_CLICK:String = fmClick

FM_CLICK represent the Fingers Motion Click Event

FM_DRAG_AND_DROPConstant 
public static const FM_DRAG_AND_DROP:String = fmDragAndDrop

FM_DRAG_AND_DROP represent the Fingers Motion Drag and Drop Event

FM_HOVERConstant 
public static const FM_HOVER:String = fmHover

FM_HOVER represent the Fingers Motion Hover Event

FM_OUTConstant 
public static const FM_OUT:String = fmOut

FM_OUT represent the Fingers Motion Out Event

FM_ROTATIONConstant 
public static const FM_ROTATION:String = fmRotation

FM_ROTATION represent the Fingers Motion Rotation Event