※現在、「wonderfl build flash online」求人コンテンツ制作に関してのアンケートを実施中です!みなさまのお力添えを頂いて、続々とアンケート結果が集まっていますが、まだまだ募集しております。ご協力のほど、どうぞよろしくお願いいたします!

wonderfl運営事務局
→アンケートページ(※ログインしてからお答えいただけるようになっています。)

 notice: Flash editor updated! Join the development! Thanks to MiniBuilder


FORKED
  1. // forked from Saqoosha's Sakotsu Camera
  2. // from zk_diary 2007-08-20 http://d.hatena.ne.jp/zk3/20070820
  3. package {
  4.     
  5.     import flash.display.Bitmap;
  6.     import flash.display.BitmapData;
  7.     import flash.display.Sprite;
  8.     import flash.events.Event;
  9.     import flash.media.Camera;
  10.     import flash.media.Video;
  11.     [SWF(width=465, height=465, frameRate=30)]
  12.     
  13.     public class FlashTest extends Sprite {
  14.         
  15.         private static const BUFFER_LEN:int = 16;
  16.         
  17.         private var _camera:Camera;
  18.         private var _video:Video;
  19.         private var _buffer:Array = [];
  20.         private var _index:int = 0;
  21.         
  22.         private var _current:Bitmap;
  23.         
  24.         public function FlashTest() {
  25.             
  26.             this._camera = Camera.getCamera();
  27.             if (!this._camera) {
  28.                 return;
  29.             }
  30.             this._camera.setMode(32024030);
  31.             this._video = new Video(320240);
  32.             this._video.attachCamera(this._camera);
  33.             
  34.             for (var i:int = 0; i < BUFFER_LEN; i++) {
  35.                 var bm:BitmapData = new BitmapData(320240false0);
  36.                 this._buffer.push(bm);
  37.                 var b:Bitmap = new Bitmap(bm);
  38.                 b.x = (i % 4) * 100;
  39.                 b.y = int(i / 4) * 100;
  40.                 b.width = 100;
  41.                 b.height = 100;
  42.                 this.addChild(b);
  43.             }
  44.             
  45.             
  46.             this._current = this.addChild(new Bitmap()) as Bitmap;
  47.             this.addEventListener(Event.ENTER_FRAME, this._update);
  48.         }
  49.         
  50.         private function _update(e:Event):void {
  51.             BitmapData(this._buffer[this._index]).draw(this._video);
  52.             if (++this._index == 16) {
  53.                 this._index = 0;
  54.             }
  55.             
  56.             this._current.bitmapData = this._buffer[int(Math.random() * BUFFER_LEN)];
  57.         }
  58.     }
  59. }
noswf
  1. // forked from Saqoosha's Sakotsu Camera
  2. // from zk_diary 2007-08-20 http://d.hatena.ne.jp/zk3/20070820
  3. package {
  4.     import flash.display.Sprite;
  5.     import flash.display.Bitmap;
  6.     import flash.display.BitmapData;
  7.     import flash.events.Event;
  8.     import flash.media.Camera;
  9.     import flash.media.Video;
  10.     import flash.text.TextField;
  11.     import flash.text.TextFieldAutoSize;
  12.     
  13.         [SWF(width=500, height=240, frameRate=30)]
  14.     
  15.     public class Main2 extends Sprite{
  16.         
  17.         private var camera:Camera;
  18.         private var video:Video;
  19.         private var screen:Bitmap;
  20.         
  21.         private static const BUFFER_LEN:int = 16;
  22.         private var bufferList:Array = [];
  23.         private var bufferIndex:int = 0;
  24.         
  25.         
  26.         //=================================================
  27.         // コンストラクタ
  28.         //=================================================
  29.         public function Main2():void{
  30.             
  31.             init();
  32.         }
  33.         
  34.         private function init():void{
  35.             
  36.             camera = Camera.getCamera();
  37.             camera.setMode( 25024030 );
  38.             video = new Video( 250 , 240 );
  39.             video.attachCamera( camera );
  40.             addChild(video);
  41.             
  42.             for (var i:int = 0; i < BUFFER_LEN; i++) {
  43.                 var bm:BitmapData = new BitmapData(400300true, 0x00ffffff);
  44.                 bufferList.push(bm);
  45.             }
  46.             
  47.             screen = addChild( new Bitmap() ) as Bitmap;
  48.             screen.scaleX = -1;
  49.             screen.x = 500;    
  50.             
  51.             var tf:TextField = addChild( new TextField() ) as TextField;
  52.             tf.text = "声が 遅れて 聞こえて くるらしい";
  53.             tf.autoSize = TextFieldAutoSize.LEFT;
  54.             tf.x = stage.stageWidth / 2 - tf.width / 2;
  55.             tf.y = 10;
  56.             
  57.             
  58.             addEventListener(Event.ENTER_FRAME, render);
  59.         }
  60.         
  61.         
  62.         // ■描画
  63.         //----------------------------------------------------------------
  64.         private function render(e:Event):void {
  65.             
  66.             BitmapData(bufferList[bufferIndex]).draw(video);
  67.             
  68.             if ( ++bufferIndex == BUFFER_LEN){
  69.                 bufferIndex = 0;
  70.             }
  71.             
  72.             screen.bitmapData = bufferList[ bufferIndex ];
  73.             
  74.         }
  75.         
  76.         
  77.         
  78.         
  79.         
  80.         
  81.         
  82.     }
  83. }
noswf
  1. // forked from Saqoosha's Sakotsu Camera
  2. package {
  3.     
  4.     import flash.display.Bitmap;
  5.     import flash.display.BitmapData;
  6.     import flash.display.Sprite;
  7.     import flash.events.Event;
  8.     import flash.media.Camera;
  9.     import flash.media.Video;
  10.     [SWF(width=465, height=465, frameRate=30)]
  11.     
  12.     public class FlashTest extends Sprite {
  13.         
  14.         private static const BUFFER_LEN:int = 16;
  15.         
  16.         private var _camera:Camera;
  17.         private var _video:Video;
  18.         private var _buffer:Array = [];
  19.         private var _index:int = 0;
  20.         
  21.         private var _current:Bitmap;
  22.         
  23.         public function FlashTest() {
  24.             
  25.             this._camera = Camera.getCamera();
  26.             if (!this._camera) {
  27.                 return;
  28.             }
  29.             this._camera.setMode(32024030);
  30.             this._video = new Video(320240);
  31.             this._video.attachCamera(this._camera);
  32.             
  33.             for (var i:int = 0; i < BUFFER_LEN; i++) {
  34.                 var bm:BitmapData = new BitmapData(320240false0);
  35.                 this._buffer.push(bm);
  36.                 var b:Bitmap = new Bitmap(bm);
  37.                 b.x = (i % 4) * 100;
  38.                 b.y = int(i / 4) * 100;
  39.                 b.width = 100;
  40.                 b.height = 100;
  41.                 this.addChild(b);
  42.             }
  43.             
  44.             
  45.             this._current = this.addChild(new Bitmap()) as Bitmap;
  46.             this.addEventListener(Event.ENTER_FRAME, this._update);
  47.         }
  48.         
  49.         private function _update(e:Event):void {
  50.             BitmapData(this._buffer[this._index]).draw(this._video);
  51.             if (++this._index == 16) {
  52.                 this._index = 0;
  53.             }
  54.             
  55.             this._current.bitmapData = this._buffer[int(Math.random() * BUFFER_LEN)];
  56.         }
  57.     }
  58. }
noswf
Get Adobe Flash Player