Page 1 of 1

Camera events trigger before the picture is taken.

Posted: Sat Feb 23, 2013 9:38 am
by Ted L

Hi,

I'm using the CameraService and I have two events which need to take place after the picture it taken, or at least in the background while the Camera is running.

I've tried using both the Success and the Complete events, but they both trigger my scripts before the camera even opens.

Thanks


Camera events trigger before the picture is taken.

Posted: Sat Feb 23, 2013 11:32 pm
by maxkatz

How did you define the events? If they are triggered before the camera opens -- what action triggers them?


Camera events trigger before the picture is taken.

Posted: Sun Feb 24, 2013 1:13 am
by Ted L

Hi Max,

I have these two events set up and I'd like them to run after the camera takes the pic, but before it returns to the page. The way it is now, when I try to open the camera, both of these scrips run, then the camera opens.

  1. mobilecamera1 Success Run JavaScript Handler: $("#j_20").show();

  2. mobilecamera1 Success Run JavaScript Handler: $("#j_23").hide();

    I've looked at the Phone Gap API docs and maybe the mistake I'm making is that the success or complete events are only related to the image.

    I've also tried to set a timer to delay these events, but it makes no difference.


Camera events trigger before the picture is taken.

Posted: Sun Feb 24, 2013 6:27 am
by Ted L

Hi Max,

It works now... bet you can't guess who's fault it was.

Yep, it was my mistake. I had it set up as an on click event and didn't remove it when I decided to test the camera success event.

I will send you a nice bottle of Vodka when my app is done, I know I must be driving you crazy :)


Camera events trigger before the picture is taken.

Posted: Sun Feb 24, 2013 4:53 pm
by maxkatz

Glad it's working. I'll take scotch :)