tags:

views:

19

answers:

1

I there a way how to take photos on laptop built-in camera controlling its control using flash? Our designer is making an application to take photos using flash action script or anything PL if not possible in flash.

+1  A: 

You can use the Camera. Check out the corresponding class in the livedocs.

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 CameraExample extends Sprite {
        private var video:Video;

        public function CameraExample() {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;

            var camera:Camera = Camera.getCamera();

            if (camera != null) {
                camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
                video = new Video(camera.width * 2, camera.height * 2);
                video.attachCamera(camera);
                addChild(video);
        } else {
            trace("You need a camera.");
        }
    }

    private function activityHandler(event:ActivityEvent):void {
        trace("activityHandler: " + event);
    }
}

}

grapefrukt