Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 15
Registered: ‎07-09-2013
My Device: Z10
My Carrier: o2
Accepted Solution

Enable camera flash



I wonder how I can enable the flash for camera in Cascades? I do not want to use the camera only the flash, like a flashlight. Do I need to open/close the Camera, though? Or do I access them seperately? I tried the sample app but this is not what I am searching for.


my idea:

Camera {
    id: camera
    onFlashMode {
      // code for enabling flash


Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: Enable camera flash

not exactly that way... FlashMode is a property of camera settings, so they need to be attached to the camera.


Camera {
    id: camera
    objectName: "camera"
    attachedObjects: [
    CameraSettings {
    id: settings

 then you can change the flashMode when a button is clicked etc.

settings.flashMode = CameraFlashMode.Off; //On, Auto, Light etc...
console.log("flash mode is: " + settings.flashMode);