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

マトリックスの世界へようこそ2

なんとなくマトリックスっぽいなにか
The 25-Line ActionScript Contest
January 2009 Finalists! Entry 001
をすこーーし改造
このflashはwebカメラが必要です
Lucida Console というフォントを使っています 持ってない方はこちらからフリーでダウンロードできるようです
http://www.webpagepublicity.com/free-fonts-l3.html#Free%20Fonts
グローフィルターを追加しただけ
重いかも
// forked from ton's マトリックスの世界へようこそ
//なんとなくマトリックスっぽいなにか
//The 25-Line ActionScript Contest
//January 2009 Finalists! Entry 001
//をすこーーし改造
//このflashはwebカメラが必要です
//Lucida Console というフォントを使っています 持ってない方はこちらからフリーでダウンロードできるようです
//http://www.webpagepublicity.com/free-fonts-l3.html#Free%20Fonts

//グローフィルターを追加しただけ
//重いかも
package {
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.events.Event;
	import flash.filters.GlowFilter;
    import flash.media.Camera;
    import flash.media.Video;
    import flash.text.TextField;
    import flash.text.TextFormat;

    [SWF(backgroundColor=0x000000)]
    public class AACamera extends Sprite {
        private const W:int = 465;
        private const H:int = 465;
        
        private var video:Video = new Video(W / 5, H / 8);
        private var bmd:BitmapData = new BitmapData(W / 5, H / 8, false);
        private var charList:Array = [" ",".",":","-",",",";","\"","。","i","t","1","+","o","3","b","8","0","%","$","#"];
        private var charLength:int = charList.length;
        private var tf:TextField = new TextField();
        private var tt:TextFormat = new TextFormat("Lucida Console", 8, 0x18793c);
		private var glow:GlowFilter = new GlowFilter(0x00ff00, 1, 3, 3);
        public function AACamera():void {
            tf.width = tf.height = W;
			tf.filters = [glow];
            addChild(tf);
            video.attachCamera(Camera.getCamera());
            addChild(video);
            addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
        }
        
        private function onEnterFrameHandler(e:Event):void {
            bmd.draw(video);
            var str:String = "";
            var h:int = bmd.height;
            var w:int = bmd.width;
            for (var i:int = 0; i < h; i++) {
                for (var j:int = 0; j < w; j++) {
                    str += charList[int((bmd.getPixel(j, i) / 0xffffff) * (charLength - 1))];
                }
                str += "\n";
            }
            tf.text = str;
            tf.setTextFormat(tt);
        }
    }
}