FlashLight is ANE about using light or torch for iOS and Android.
On Android:
-
you need to enable the following permissions (otherwise the returned state will always be not connected):
<android> <manifestAdditions><![CDATA[ <manifest android:installLocation="auto"> ... <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FLASHLIGHT" /> ... </manifest> ]]></manifestAdditions> </android>
if( Flashlight.getInstance().isSupported ){
Flashlight.getInstance().on(); // turn on
Flashlight.getInstance().off(); // turn off
var mode:Boolean = Flashlight.getInstance().mode; // get torch mode
}