4 Replies Latest reply on Jul 8, 2011 3:11 PM by Piotr Wierzgała

    camera - black frame

    Piotr Wierzgała

      Hi,

       

      I'm trying to make my camera work with Camera class but instead of vido stream I get a black frame in my VideoDisplay object. I looks like my camera doesn't work with filex but is it possible? When I use it with other application (e.g. Skype) it works fine.

       

      I used code copied from some web page (it works for my friend):

       

      <fx:Script>
      <![CDATA[
           import mx.controls.Alert;
                     
           private function videoDisplay_creationComplete():void {                    
                var camera:Camera = Camera.getCamera();
                if (camera) {
                     videoDisplay.attachCamera(camera);
                } else {
                     Alert.show("You don't seem to have a camera.");
                }
           }
      ]]>
      </fx:Script>
                     
           
      <mx:Button id="button"
           label="Reload Camera"
           click="videoDisplay_creationComplete();" />     
      
      <mx:VideoDisplay id="videoDisplay"
           creationComplete="videoDisplay_creationComplete();"
           width="100%"
           height="100%" />
      

      My question is: what is wrong that my camera works with Skype but not with Flex?