I have just tried the code from your last post in the Flashlight plugin demo and I think it works as expected. Keep in mind that this plugin will only work on an actual device that has a flash light.
I have attached the modified demo project for reference. Here is the code I added in scripts/demo.js:
on = [
And in index.html I added one more button:
>Switch ON/Off From Array</
Deploy the project on your device, go to the Demo tab and tap the Switch On/Off From Array button. The flashlight should flash 3 times.
The only difference is that I added some more true and false values for 3 flashes. Try the attached project and let me know if it works on your side. I have tested this on Android Nexus 5 with Android 5.1.