package { import flash.display.Sprite; import flash.media.Video; import flash.media.Camera; import flash.events.Event; import flash.events.ActivityEvent; import flash.text.TextField; public class Main extends Sprite { private var cam:Camera; private var vid:Video; private var hasCamera:Boolean = true; private var text:TextField;
public function Main () { cam = flash.media.Camera.getCamera(); vid = new Video(); vid.attachCamera(cam); addChild(vid); cam.setMotionLevel(20); this.addEventListener("enterFrame", enterFrame); cam.addEventListener(ActivityEvent.ACTIVITY, active); text = new TextField(); addChild(text); text.x = 300; }