In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

CameraSample01

Get Adobe Flash player
by ll_koba_ll 15 Oct 2009
/**
 * Copyright ll_koba_ll ( http://wonderfl.net/user/ll_koba_ll )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/yE7b
 */

package
{
    import flash.display.Sprite;
    import flash.media.*;

    public class CameraSample01 extends Sprite {
        public function CameraSample01() {
            // カメラの取得
            var camera:Camera = Camera.getCamera();
            if (camera == null) {
                // カメラが存在しない
                return;
            }
            // カメラの設定
            camera.setMode(320, 240, 30);
            var video:Video = new Video();
            // videoにアタッチ
            video.attachCamera(camera);
            // 表示オブジェクトに追加
            addChild(video);
        }
    }
}