Chapter 33 Example 2
♥0 |
Line 19 |
Modified 2010-02-05 16:26:29 |
MIT License
archived:2017-03-10 02:20:25
ActionScript3 source code
/**
* Copyright actionscriptbible ( http://wonderfl.net/user/actionscriptbible )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/9n2P
*/
package {
import com.actionscriptbible.Example;
import flash.media.Camera;
import flash.media.Video;
public class ch33ex2 extends Example {
protected const S:Number = 2; //scale down factor
public function ch33ex2() {
var camera:Camera = Camera.getCamera();
if (!camera) return;
camera.setMode(stage.stageWidth/S, stage.stageHeight/S, 90, false);
var video:Video = new Video(camera.width*S, camera.height*S);
video.attachCamera(camera);
video.smoothing = false;
addChildAt(video, 0);
trace("Used", camera.width, "x", camera.height, "@", camera.fps, "FPS");
trace("Stage size was", stage.stageWidth, stage.stageHeight);
}
}
}