1 Reply Latest reply on Sep 12, 2010 3:21 PM by dave nando

    Problem detaching webcam

    flexJu

      Hi,

       

      I am doing a little app that display a webcam, take pictures and some other stuff.

       

      I can see the webcam, everything goes fine, but I have one problem:

       

      I want to detach the webcam from the videodisplay in order not to get the camera when i am on another part of my app.

      The little led showing that the webcam is active is always on and the only way I found to stop it is to stop my app.

       

      My question is the following: how to stop the webcam?

       

      Here is my code for attaching the webcam:

       

      public function init():void{

       

      camera=Camera.getCamera("0");

      camera.setMode(640,480,25);

      if(camera!=null) display.attachCamera(camera);

      }

       

      and for the videodisplay:

      <mx:VideoDisplay id ="display" width="666" height="500" />

      I tried display.stop(); display.close() but nothing happens and the led is still on.
      Thanks for those who will answer
      Julien