Please elaborate what you are trying to do
To switch on/off the flashlight programmatically? Try the flashlight extension
Taifun