Paste Code
Paste Blends
Paste Images
    /**
* @author Kai Kajus Noack
* http://media-it.blogspot.com
* @version 0.1 (July 2008)
*
* Copyright (c) 2008 Kai Kajus Noack. All rights reserved.
*
* Licensed under the CREATIVE COMMONS Attribution-NonCommercial-ShareAlike 2.0 you may not use this
* file except in compliance with the License. You may obtain a copy of the License at:
* http://creativecommons.org/licenses/by-nc-sa/2.0/de/deed.en
*
*/

package {

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.*;
import flash.media.Camera;
import flash.media.Video;

public class cameraClass extends Sprite {
public var camVideo:Video;
public var camera:Camera;

public function cameraClass(width:int, height:int) {
camera = Camera.getCamera();
//camera.addEventListener(ActivityEvent.ACTIVITY,activated);
if (camera != null) {
camVideo = new Video(width, height);// camera.width * 2, camera.height * 2);
camVideo.attachCamera(camera);
//addChild(camVideo);
camera.setMode(width, height, 15); // 15 FPS
} else {
trace("Please connect a camera to the computer.");
}
}
}
}
  1.    /**
  2.      * @author  Kai Kajus Noack
  3.      *                          http://media-it.blogspot.com
  4.      * @version 0.1 (July 2008)
  5.      *
  6.      * Copyright (c) 2008 Kai Kajus Noack. All rights reserved.
  7.      *
  8.      * Licensed under the CREATIVE COMMONS Attribution-NonCommercial-ShareAlike 2.0 you may not use this
  9.      * file except in compliance with the License. You may obtain a copy of the License at:
  10.      * http://creativecommons.org/licenses/by-nc-sa/2.0/de/deed.en
  11.      *
  12.      */
  13.  
  14. package {
  15.        
  16.         import flash.display.Sprite;
  17.         import flash.display.StageAlign;
  18.         import flash.display.StageScaleMode;
  19.         import flash.events.*;
  20.         import flash.media.Camera;
  21.         import flash.media.Video;
  22.  
  23.         public class cameraClass extends Sprite {
  24.                 public var camVideo:Video;
  25.                 public var camera:Camera;
  26.  
  27.                 public function cameraClass(width:int, height:int) {
  28.                         camera = Camera.getCamera();
  29.                         //camera.addEventListener(ActivityEvent.ACTIVITY,activated);
  30.                         if (camera != null) {
  31.                                 camVideo = new Video(width, height);// camera.width * 2, camera.height * 2);
  32.                                 camVideo.attachCamera(camera);
  33.                                 //addChild(camVideo);
  34.                                 camera.setMode(width, height, 15); // 15 FPS
  35.                         } else {
  36.                                 trace("Please connect a camera to the computer.");
  37.                         }
  38.                 }
  39.         }
  40. }
go to heaven