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


embed

FORKED
  1. // forked from ton's マトリックスの世界へようこそ
  2. //なんとなくマトリックスっぽいなにか
  3. //The 25-Line ActionScript Contest
  4. //January 2009 Finalists! Entry 001
  5. //をすこーーし改造
  6. //このflashはwebカメラが必要です
  7. //Lucida Console というフォントを使っています 持ってない方はこちらからフリーでダウンロードできるようです
  8. //http://www.webpagepublicity.com/free-fonts-l3.html#Free%20Fonts
  9. package {
  10.     import flash.display.BitmapData;
  11.     import flash.display.Sprite;
  12.     import flash.events.Event;
  13.     import flash.media.Camera;
  14.     import flash.media.Video;
  15.     import flash.text.TextField;
  16.     import flash.text.TextFormat;
  17.     [SWF(backgroundColor=0x000000)]
  18.     public class AACamera extends Sprite {
  19.         private const W:int = 465;
  20.         private const H:int = 465;
  21.         
  22.         private var video:Video = new Video(W / 5, H / 8);
  23.         private var bmd:BitmapData = new BitmapData(W / 5, H / 8false);
  24.         private var charList:Array = [" ",".",":","-",",",";","\"","。","i","t","1","+","o","3","b","8","0","%","$","#"];
  25.         private var charLength:int = charList.length;
  26.         private var tf:TextField = new TextField();
  27.         private var tt:TextFormat = new TextFormat("Lucida Console"8, 0x18793c);
  28.         public function AACamera():void {
  29.             tf.width = tf.height = W;
  30.             addChild(tf);
  31.             video.attachCamera(Camera.getCamera());
  32.             addChild(video);
  33.             addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
  34.         }
  35.         
  36.         private function onEnterFrameHandler(e:Event):void {
  37.             bmd.draw(video);
  38.             var str:String = "";
  39.             var h:int = bmd.height;
  40.             var w:int = bmd.width;
  41.             for (var i:int = 0; i < h; i++) {
  42.                 for (var j:int = 0; j < w; j++) {
  43.                     str += charList[int((bmd.getPixel(j, i) / 0xffffff) * (charLength - 1))];
  44.                 }
  45.                 str += "\n";
  46.             }
  47.             tf.text = str;
  48.             tf.setTextFormat(tt);
  49.         }
  50.     }
  51. }
noswf

マトリックスの世界へようこそ カタカナcam [diff(39)]

  1. // forked from ton's マトリックスの世界へようこそ
  2. //なんとなくマトリックスっぽいなにか
  3. package {
  4.     import flash.display.BitmapData;
  5.     import flash.display.Sprite;
  6.     import flash.events.Event;
  7.     import flash.media.Camera;
  8.     import flash.media.Video;
  9.     import flash.text.TextField;
  10.     import flash.text.TextFormat;
  11.     [SWF(backgroundColor=0x000000, frameRate=24)]
  12.     public class MatrixCascade extends Sprite {
  13.         private const W:int = 465;
  14.         private const PW:int = W / 5;
  15.         private const H:int = 465;
  16.         private const PH:int = H / 8;
  17.         
  18.         private var video:Video = new Video(PW, PH);
  19.         private var bmd:BitmapData = new BitmapData(PW, PH, false);
  20.         private var lastFrame:Array = new Array(PW);
  21.         private var charList:Array = [
  22.             " "," ",
  23.             "ノ","ノ","ノ",
  24.             "ニ","レ","ト","ソ","ン","リ",
  25.             "ミ","ウ","シ","ツ","キ","モ",
  26.             "ネ","オ","ヌ","タ","チ","テ"];
  27.         private var numChars:int = charList.length;
  28.         private var tf:TextField = new TextField();
  29.         private var tt:TextFormat = new TextFormat("Hiragino Kaku Gothic Pro W3, Shin Go, Heisei Kaku Gothic W5, Courier New, sans-serif"8, 0xffffff);
  30.         
  31.         public function MatrixCascade():void {
  32.             tf.width = tf.height = W;
  33.             addChild(tf);
  34.             
  35.             for (var i:int = 0; i < lastFrame.length; i++){
  36.                 lastFrame[i] = new Array(PH);
  37.             }
  38.             
  39.             video.attachCamera(Camera.getCamera());
  40.             //addChild(video);
  41.             addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
  42.         }
  43.         
  44.         private function onEnterFrameHandler(e:Event):void {
  45.             bmd.draw(video);
  46.             var str:String = "";
  47.             var h:int = bmd.height;
  48.             var w:int = bmd.width;
  49.             for (var i:int = 0; i < h; i++) {
  50.                 for (var j:int = 0; j < w; j++) {
  51. //                   var pixel:String = charList[int((bmd.getPixel(j, i) / 0xffffff) * numChars)];
  52. //                    if (pixel == lastFrame[i][j]) {
  53. //                        str += pixel;
  54. //                    } else {
  55. //                        str += pixel;
  56. //                    }
  57. //                    lastFrame[i][j] = pixel;
  58.                     str += charList[int((bmd.getPixel(j, i) / 0xffffff) * numChars)];
  59.                 }
  60.                 str += "\n";
  61.             }
  62.             tf.text = str;
  63.             tf.setTextFormat(tt);
  64.         }
  65.     }
  66. }
noswf
  1. // forked from ton's マトリックスの世界へようこそ
  2. //なんとなくマトリックスっぽいなにか
  3. //The 25-Line ActionScript Contest
  4. //January 2009 Finalists! Entry 001
  5. //をすこーーし改造
  6. //このflashはwebカメラが必要です
  7. //Lucida Console というフォントを使っています 持ってない方はこちらからフリーでダウンロードできるようです
  8. //http://www.webpagepublicity.com/free-fonts-l3.html#Free%20Fonts
  9. package {
  10.     import flash.display.BitmapData;
  11.     import flash.display.Sprite;
  12.     import flash.events.Event;
  13.     import flash.media.Camera;
  14.     import flash.media.Video;
  15.     import flash.text.TextField;
  16.     import flash.text.TextFormat;
  17.     [SWF(width = "640", height = "480", backgroundColor = 0x000000, frameRate = "60")]
  18.     public class AACamera extends Sprite {
  19.         private const W:int = 640;
  20.         private const H:int = 480;
  21.         
  22.         private var video:Video = new Video(W / 5, H / 8);
  23.         private var bmd:BitmapData = new BitmapData(W / 5, H / 8false);
  24.         private var charList:Array = [" ",".",":","-",",",";","\"","。","i","t","1","+","o","3","b","8","0","%","$","#"];
  25.         private var charLength:int = charList.length;
  26.         private var tf:TextField = new TextField();
  27.         private var tt:TextFormat = new TextFormat("Lucida Console"8, 0xFF0000);
  28.         public function AACamera():void {
  29.             tf.width = tf.height = W;
  30.             addChild(tf);
  31.             video.attachCamera(Camera.getCamera());
  32.             //addChild(video);
  33.             addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
  34.         }
  35.         
  36.         private function onEnterFrameHandler(e:Event):void {
  37.             bmd.draw(video);
  38.             video.x = 0;
  39.             video.y = 0;
  40.             var str:String = "";
  41.             var h:int = bmd.height;
  42.             var w:int = bmd.width;
  43.             for (var i:int = 0; i < h; i++) {
  44.                 for (var j:int = 0; j < w; j++) {
  45.                     str += charList[int((bmd.getPixel(j, i) / 0xffffff) * (charLength - 1))];
  46.                 }
  47.                 str += "\n";
  48.             }
  49.             tf.text = str;
  50.             tf.setTextFormat(tt);
  51.         }
  52.     }
  53. }
noswf

マトリックスの世界へようこそ マトリックスの世界へようこそ2 [diff(7)]

  1. // forked from ton's マトリックスの世界へようこそ
  2. //なんとなくマトリックスっぽいなにか
  3. //The 25-Line ActionScript Contest
  4. //January 2009 Finalists! Entry 001
  5. //をすこーーし改造
  6. //このflashはwebカメラが必要です
  7. //Lucida Console というフォントを使っています 持ってない方はこちらからフリーでダウンロードできるようです
  8. //http://www.webpagepublicity.com/free-fonts-l3.html#Free%20Fonts
  9. //グローフィルターを追加しただけ
  10. //重いかも
  11. package {
  12.     import flash.display.BitmapData;
  13.     import flash.display.Sprite;
  14.     import flash.events.Event;
  15.     import flash.filters.GlowFilter;
  16.     import flash.media.Camera;
  17.     import flash.media.Video;
  18.     import flash.text.TextField;
  19.     import flash.text.TextFormat;
  20.     [SWF(backgroundColor=0x000000)]
  21.     public class AACamera extends Sprite {
  22.         private const W:int = 465;
  23.         private const H:int = 465;
  24.         
  25.         private var video:Video = new Video(W / 5, H / 8);
  26.         private var bmd:BitmapData = new BitmapData(W / 5, H / 8false);
  27.         private var charList:Array = [" ",".",":","-",",",";","\"","。","i","t","1","+","o","3","b","8","0","%","$","#"];
  28.         private var charLength:int = charList.length;
  29.         private var tf:TextField = new TextField();
  30.         private var tt:TextFormat = new TextFormat("Lucida Console"8, 0x18793c);
  31.         private var glow:GlowFilter = new GlowFilter(0x00ff00, 133);
  32.         public function AACamera():void {
  33.             tf.width = tf.height = W;
  34.             tf.filters = [glow];
  35.             addChild(tf);
  36.             video.attachCamera(Camera.getCamera());
  37.             addChild(video);
  38.             addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);
  39.         }
  40.         
  41.         private function onEnterFrameHandler(e:Event):void {
  42.             bmd.draw(video);
  43.             var str:String = "";
  44.             var h:int = bmd.height;
  45.             var w:int = bmd.width;
  46.             for (var i:int = 0; i < h; i++) {
  47.                 for (var j:int = 0; j < w; j++) {
  48.                     str += charList[int((bmd.getPixel(j, i) / 0xffffff) * (charLength - 1))];
  49.                 }
  50.                 str += "\n";
  51.             }
  52.             tf.text = str;
  53.             tf.setTextFormat(tt);
  54.         }
  55.     }
  56. }
noswf
Get Adobe Flash Player