Adobe Animate Air - android using phone proximity sensor to turn off screen?

25 Views Asked by At

Still trying to explore action script. Is there any way to access an android phone proximity sensor? Would like to turn off the sceen using the output from the sensor. Found the richardolsson / proximity-sensor-ane ( https://github.com/richardolsson/proximity-sensor-ane?search=1 ) TBH I don't have a clue what I am doing with it. Any help would be awesom. TIA

import se.riol.anes.proximitysensor.ProximitySensorInterface;

var proximity:ProximitySensorInterface;

proximity = new ProximitySensorInterface();
proximity.addEventListener(StatusEvent.STATUS, handleProximity);
proximity.start();

function handleProximity(ev:StatusEvent):void
{
    trace('proximity: ' + ev.level);
}
0

There are 0 best solutions below