Packagecom.dipigraphics.fingersMotion
Classpublic class fingersMotion
InheritancefingersMotion Inheritance flash.display.Sprite

The FingersMotion Class allow you to interact with your fingers using 3 colored markers.

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
  fingersMotionStatut : int = 0
Define the Status Event for the switch condition that dispatch event 0 : normal mode 1 : hover mode 2 : drag and drop mode 3 : click mode Note : you dont need it normally except if you try to change the navigation system created.
fingersMotion
Public Methods
 MethodDefined By
  
fingersMotion(conteneurSprite:Sprite, markerVisibility:Boolean = true, previewCamera:Boolean = false, previewCameraScaleFactor:Number = 1)
This method provides all you need to start the navigation system.
fingersMotion
  
addCameraView(scaleFactor:Number = 1, posX:int = -100, posY:int = -100):void
fingersMotion
  
This method allow you to get the sprite markers as an object.
fingersMotion
  
getMarkers():Object
This method allow you to get the position of the markers as an object.
fingersMotion
  
this method remove the cameraView only if you have already it in the DisplayList.
fingersMotion
  
switchCustomMenuItems(menuLabel:String, newMenuLabel:String):void
[static] This method allow you to switch the state of the FingersMotionMenu Item.
fingersMotion
Property Detail
fingersMotionStatutproperty
public var fingersMotionStatut:int = 0

Define the Status Event for the switch condition that dispatch event

Note : you dont need it normally except if you try to change the navigation system created.

Constructor Detail
fingersMotion()Constructor
public function fingersMotion(conteneurSprite:Sprite, markerVisibility:Boolean = true, previewCamera:Boolean = false, previewCameraScaleFactor:Number = 1)

This method provides all you need to start the navigation system.

Parameters
conteneurSprite:Sprite — This is the container that you must specified to apply the detection on it. Each Object in this container can interact with the FingresMotionEvent class.
 
markerVisibility:Boolean (default = true) — Allow you to enable/disable the default marker representation on the screen, set it to true : display 3 circles that represent the position of each marker.
 
previewCamera:Boolean (default = false) — Allow you to enable/disable the camera display box placed in the bottom right corner of your animation.
 
previewCameraScaleFactor:Number (default = 1) — define the width of the preview.

See also


Example
This example show you a simple way to start the Fingers Motion System :

Assuming that your application is in the mainContainer sprite

         var myNavigation:FingersMotion = new fingersMotion(mainContainer,true,true);
         addChild(myNavigation);
         

Note that you must have your navigation above your container in the DisplayList.

Method Detail
addCameraView()method
public function addCameraView(scaleFactor:Number = 1, posX:int = -100, posY:int = -100):void

Parameters

scaleFactor:Number (default = 1)
 
posX:int (default = -100)
 
posY:int (default = -100)

getDisplayMarkers()method 
public function getDisplayMarkers():Object

This method allow you to get the sprite markers as an object.

DisplayMarkers (Object) contains three Sprite.

Don't Work if you have set markerVisibility:Boolean to false.

Returns
Object

Example
Simple use to show you how to handle with it :
         //Start FingersMotion
         var myNavigation:FingersMotion = new fingersMotion(mainContainer,true,true);
         addChild(myNavigation);
         
         //Create an Object "markers" 
         var markers:Object = myNavigation.getDisplayMarkers();
         trace(markers.blue);
         //OUTPUT => Object Sprite
         
getMarkers()method 
public function getMarkers():Object

This method allow you to get the position of the markers as an object.

Markers (Object) contains three Point

Returns
Object

Example
Simple use to show you how to handle with it :
         //Start FingersMotion
         var myNavigation:FingersMotion = new fingersMotion(mainContainer,true,true);
         addChild(myNavigation);
         
         //Create an Object "markers" and get the position of the markers
         var markers:Object = myNavigation.getMarkers();
         trace("blueX : "+markers.blue.x+" blueY : "+markers.blue.y);
         //OUTPUT => blueX : 120 blueY : 30
         
removeCameraView()method 
public function removeCameraView():void

this method remove the cameraView only if you have already it in the DisplayList.

switchCustomMenuItems()method 
public static function switchCustomMenuItems(menuLabel:String, newMenuLabel:String):void

This method allow you to switch the state of the FingersMotionMenu Item.

Parameters

menuLabel:String — The actual menuItem you want to switch. The value expected can only be "Open Fingers Motion Setup" or "Close Fingers Motion Setup"
 
newMenuLabel:String — the new menuItem name you want. The value expected can only be "Open Fingers Motion Setup" or "Close Fingers Motion Setup"

If you want add more Items edit the class fingersMotion.as see lines 406 to 478


Example
switch menuItem :
         switchCustomMenuItems("Open Fingers Motion Setup", "Close Fingers Motion Setup");