开发者

flash action-scripting activating a laptop camera

开发者 https://www.devze.com 2022-12-31 04:20 出处:网络
I there a way how to take photos on laptop built-in camera controlling its contr开发者_运维技巧ol using flash? Our designer is making an application to take photos using flash action script or anythin

I there a way how to take photos on laptop built-in camera controlling its contr开发者_运维技巧ol using flash? Our designer is making an application to take photos using flash action script or anything PL if not possible in flash.


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);
    }
}

}

0

精彩评论

暂无评论...
验证码 换一张
取 消