I want to use xbox kinect to run a flash application with a motion sensor, I've got a simple software to perform the function of moving the mouse and click. unfortunately not be done with just one hand, right hand to move the mouse and click the left hand to command. I wish it could be done with just one hand. My idea is to replace the function of mouse click with the mouse over function, provided that the delay was extended, can it be done? please help me how to set it to AS3, the key word is the delay time (ex three seconds) when there is mouse over the button, so that applications can run flash properly. or any advice or any other way for me?
Asked
Active
Viewed 1,296 times
1 Answers
4
Easily done like so, might want to adjust this if you're having more than 1 button but it's quite easy to adjust if so.
var timer:Timer = new Timer(3000);
timer.addEventListener(TimerEvent.TIMER, onTimerTickHandler);
button.addEventListener(MouseEvent.ROLL_OVER, _onRollOverHandler);
button.addEventListener(MouseEvent.ROLL_OUT, _onRollOutHandler);
private function _onRollOverHandler(e:MouseEvent):void
{
timer.start();
}
private function _onRollOutHandler(e:MouseEvent):void
{
timer.reset();
}
private function _onTimerTickHandler(e:TimerEvent):void
{
timer.reset();
// do something
}
Hope that helps.
EDIT: The reason I use MouseEvent.ROLL_OVER
/MouseEvent.ROLL_OUT
is because you'll experience a lot less problems this way, check the documentation if you want to know the exact difference. Good luck with your project.

xLite
- 1,441
- 3
- 15
- 28
-
How did it go? hate seeing questions go without an accepted answer after this much time haha :P – xLite Jun 13 '12 at 18:37