The light keep turning off automatically



Hello everyone,

i have a problem with the flash light. I want to control the LED light of my Android phone with the App Inventor. If I press and hold the button, I want to implement a function that flashes at 1 second intervals and presses it briefly to turn the light on/off.

Flashing light succeeded in implementation, but when pressed briefly, the light keeps turning off automatically after 1 second.

I googled for related issues but got zero idea how to solve this… So I post a my problem here.Here is my code picture. I’m using Taifun flashlight extension

Flashlight with 1 second interval

what is the purpose of the global variable flag?
you might want to try the TouchUp event to stop the clock and the LongCLick event to start the clock… no need to use global variables as flags…


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.