Posted By

visualadvance on 04/17/11


Tagged

video camera webcam


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

letmein_xxi
tamak


AS3: Webcam


 / Published in: ActionScript 3
 

  1. import flash.media.Camera;
  2. import flash.media.Video;
  3.  
  4. private function getCamera ():void
  5. {
  6. //Create a video instance
  7. var video:Video = new Video(640, 480);
  8. //Get the camera reference.
  9. var camera:Camera = Camera.getCamera();
  10. //setMode need 3 params, width, height and frame rate.
  11. //Optianally you can set a boolean value at the end for the favorArea.
  12. camera.setMode(640, 480, 30);
  13. //put the camera in the video instance
  14. video.attachCamera(camera);
  15. addChild(video);
  16. }

Report this snippet  

You need to login to post a comment.