Packagepegas.transitions
Classpublic class EasingController

The EasingController register easing methods. This controller can be use with an external configuration or a dynamic easing engine. This controller centralize all easing method in the application.

Example :

  import pegas.transitions.easing.;
   import pegas.transitions.EasingController ;
  import pegas.transitions.Tween ;
  
  var controller:EasingController = new EasingController() ;
  controller.insert( "elastic_ease_out" , Elastic.easeOut ) ;
  controller.insert( "elastic_ease_in"  , Elastic.easeIn ) ;
  
  // in the code
  
  var easing:Function = controller.getEasing( "elastic_ease_out" ) ;
  
  var tw:Tween = new Tween( mc, "_x" , easing, mc._x, 500, 24 , false, true) ; // mc a display on the root.
  



Public Methods
 MethodDefined by
  
Creates a new EasingController instance.
EasingController
  
clear():void
Removes all elements in this controller.
EasingController
  
contains(id:String):Boolean
Returns true if the id passed in argument is registered in the EasingController.
EasingController
  
getEasing(id:String, defaultEasing:Function = null):Function
Returns a easing method register in the EasingController with the specified id passed in argument.
EasingController
  
[static] Returns the singleton instance of EasingController.
EasingController
  
insert(id:String, easingMethod:Function):void
Adds a new entry into the EasingController.
EasingController
  
remove(id:String):void
Remove an entry into the EasingController.
EasingController
  
size():Number
Returns the number of elements in the EasingController.
EasingController
Constructor detail
EasingController()constructor
public function EasingController()

Creates a new EasingController instance.

Usage :

   var ec:EasingController = new EasingController() ;
   
Method detail
clear()method
public function clear():void

Removes all elements in this controller.

contains()method 
public function contains(id:String):Boolean

Returns true if the id passed in argument is registered in the EasingController.

Parameters
id:String — the id of the easing method mapped in the EasingController.

Returns
Booleantrue if the id passed in argument is registered in the EasingController.
getEasing()method 
public function getEasing(id:String, defaultEasing:Function = null):Function

Returns a easing method register in the EasingController with the specified id passed in argument. If the id isn't find in the controller, this method return a Regular.easeOut function.

Parameters
id:String — id the id of the easing method mapped in the EasingController.
 
defaultEasing:Function (default = null)

Returns
Function — the easing method mapped in the EasingController.
getInstance()method 
public static function getInstance():EasingController

Returns the singleton instance of EasingController.

Returns
EasingController — singleton instance of EasingController.
insert()method 
public function insert(id:String, easingMethod:Function):void

Adds a new entry into the EasingController.

Parameters
id:String — the id of the easing method mapped in the EasingController.
 
easingMethod:Function — the function to register in the EasingController.
remove()method 
public function remove(id:String):void

Remove an entry into the EasingController.

Parameters
id:String — the name of the easing method mapped in the EasingController.
size()method 
public function size():Number

Returns the number of elements in the EasingController.

Returns
Number — the number of elements in the EasingController.