Packagecom.myflashlab.air.extensions.vibration
Classpublic class Vibration
InheritanceVibration Inheritance Object

Class that operates the vibrator on the device.



Public Methods
 MethodDefined By
  
cancel():void
[static] Cancel ongoing vibration on Android.
Vibration
  
hasVibrator():Boolean
[static] Check whether the hardware has a vibrator.
Vibration
  
init():void
[static] To use this extension, you must first initialize it with this method.
Vibration
  
vibrate($duration:int = 500):void
[static] Vibrate constantly for the specified period of time on Android.
Vibration
  
vibratePattern($pattern:Array, $repeat:int):void
[static] Vibrate with a given pattern on Android.
Vibration
Public Constants
 ConstantDefined By
  DREAM_THEATER_FATAL_TRAGEDY : Array
[static]
Vibration
  DREAM_THEATER_OVERTURE_1928_INTRO : Array
[static]
Vibration
  DREAM_THEATER_STRANGE : Array
[static]
Vibration
  EXTENSION_ID : String = com.myflashlab.air.extensions.vibration
[static]
Vibration
  FINAL_FANTASY_VICTORY_FANFARE : Array
[static]
Vibration
  FIVE_REPEAT : int = 5
[static]
Vibration
  FOUR_REPEAT : int = 4
[static]
Vibration
  GO_GO_POWER_RANGERS : Array
[static]
Vibration
  GRAVEL_ROAD : Array
[static]
Vibration
  INFINITY_REPEAT : int = 0
[static]
Vibration
  JAMES_BAND_007 : Array
[static]
Vibration
  KARNIVOOL_COTE : Array
[static]
Vibration
  MICHAEL_JACKSON_SMOOTH_CRIMINAL : Array
[static]
Vibration
  MORSE_CODE_SOS : Array
[static]
Vibration
  MORTAL_KOMBAT_THEME : Array
[static]
Vibration
  MUSE_MADNESS : Array
[static]
Vibration
  NO_REPEAT : int = -1
[static]
Vibration
  ONE_REPEAT : int = 1
[static]
Vibration
  PAIN_OF_SALVATION_NIHIL_MORARI : Array
[static]
Vibration
  SHAVE_AND_A_HAIRCUT : Array
[static]
Vibration
  STAR_WARS_IMPERIAL_MARCH : Array
[static]
Vibration
  SUPER_MARIO_THEME_INTRO : Array
[static]
Vibration
  TEENAGE_MUTANT_NINJA_TURTLES : Array
[static]
Vibration
  TESSERACT_NOCTURNE : Array
[static]
Vibration
  TESSERACT_PERFECTION : Array
[static]
Vibration
  THREE_REPEAT : int = 3
[static]
Vibration
  TWO_REPEAT : int = 2
[static]
Vibration
  VERSION : String = 0.0.1
[static]
Vibration
  VOLTRON_THEME : Array
[static]
Vibration
Method Detail
cancel()method
public static function cancel():void

Cancel ongoing vibration on Android.

         Vibration.vibrate(duration: 10000);
         Vibration.cancel();
     

hasVibrator()method 
public static function hasVibrator():Boolean

Check whether the hardware has a vibrator.

         if (Vibration.hasVibrator()) {
               Vibration.vibrate();
         }
     

Returns
Boolean — Boolean
init()method 
public static function init():void

To use this extension, you must first initialize it with this method.

vibrate()method 
public static function vibrate($duration:int = 500):void

Vibrate constantly for the specified period of time on Android. Vibrate for default period of 500 milliseconds on iOS.

         Vibration.vibrate();
          Vibration.vibrate(1000);
     

Parameters

$duration:int (default = 500) — The number of milliseconds to vibrate.

vibratePattern()method 
public static function vibratePattern($pattern:Array, $repeat:int):void

Vibrate with a given pattern on Android.

         Vibration.vibratePattern(Vibration.SUPER_MARIO_THEME_INTRO, Vibration.TWO_REPEAT);
              pattern: Array = [0, 150, 150, 150, 150, 75, 75, 150, 150, 150, 150, 450];
         Vibration.vibratePattern(pattern, Vibration.NO_REPEAT);
     

Parameters

$pattern:Array — an array of longs of times for which to turn the vibrator on or off.
 
$repeat:int — the index into pattern at which to repeat, or -1 if you don't want to repeat.

Constant Detail
DREAM_THEATER_FATAL_TRAGEDYConstant
public static const DREAM_THEATER_FATAL_TRAGEDY:Array

DREAM_THEATER_OVERTURE_1928_INTROConstant 
public static const DREAM_THEATER_OVERTURE_1928_INTRO:Array

DREAM_THEATER_STRANGEConstant 
public static const DREAM_THEATER_STRANGE:Array

EXTENSION_IDConstant 
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.vibration

FINAL_FANTASY_VICTORY_FANFAREConstant 
public static const FINAL_FANTASY_VICTORY_FANFARE:Array

FIVE_REPEATConstant 
public static const FIVE_REPEAT:int = 5

FOUR_REPEATConstant 
public static const FOUR_REPEAT:int = 4

GO_GO_POWER_RANGERSConstant 
public static const GO_GO_POWER_RANGERS:Array

GRAVEL_ROADConstant 
public static const GRAVEL_ROAD:Array

INFINITY_REPEATConstant 
public static const INFINITY_REPEAT:int = 0

JAMES_BAND_007Constant 
public static const JAMES_BAND_007:Array

KARNIVOOL_COTEConstant 
public static const KARNIVOOL_COTE:Array

MICHAEL_JACKSON_SMOOTH_CRIMINALConstant 
public static const MICHAEL_JACKSON_SMOOTH_CRIMINAL:Array

MORSE_CODE_SOSConstant 
public static const MORSE_CODE_SOS:Array

MORTAL_KOMBAT_THEMEConstant 
public static const MORTAL_KOMBAT_THEME:Array

MUSE_MADNESSConstant 
public static const MUSE_MADNESS:Array

NO_REPEATConstant 
public static const NO_REPEAT:int = -1

ONE_REPEATConstant 
public static const ONE_REPEAT:int = 1

PAIN_OF_SALVATION_NIHIL_MORARIConstant 
public static const PAIN_OF_SALVATION_NIHIL_MORARI:Array

SHAVE_AND_A_HAIRCUTConstant 
public static const SHAVE_AND_A_HAIRCUT:Array

STAR_WARS_IMPERIAL_MARCHConstant 
public static const STAR_WARS_IMPERIAL_MARCH:Array

SUPER_MARIO_THEME_INTROConstant 
public static const SUPER_MARIO_THEME_INTRO:Array

TEENAGE_MUTANT_NINJA_TURTLESConstant 
public static const TEENAGE_MUTANT_NINJA_TURTLES:Array

TESSERACT_NOCTURNEConstant 
public static const TESSERACT_NOCTURNE:Array

TESSERACT_PERFECTIONConstant 
public static const TESSERACT_PERFECTION:Array

THREE_REPEATConstant 
public static const THREE_REPEAT:int = 3

TWO_REPEATConstant 
public static const TWO_REPEAT:int = 2

VERSIONConstant 
public static const VERSION:String = 0.0.1

VOLTRON_THEMEConstant 
public static const VOLTRON_THEME:Array