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

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

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


forked from : northprint's Bitmapdata.noise [diff(36)]

FORKED
  1. // forked from northprint's forked from: Bitmapdata.noise
  2. // forked from northprint's Bitmapdata.noise
  3. //コマンドのループ
  4. // write as3 code here..
  5. package{
  6.     import flash.display.*;
  7.     import flash.events.*;
  8.     import jp.progression.commands.*;
  9.     import jp.progression.events.*;
  10.     public class NoiseTest extends MovieClip{
  11.         private var _bitmapdata:BitmapData;
  12.         private var _bitmap:Bitmap;
  13.         private var _sList:SerialList;
  14.         public function NoiseTest(){
  15.             _sList = new SerialList();
  16.             _bitmapdata = new BitmapData(stage.stageWidth,stage.stageHeight,true);
  17.             _bitmap = new Bitmap(_bitmapdata);
  18.             this.addChild(_bitmap);
  19.             
  20.             _sList.addEventListener(CommandEvent.COMMAND_COMPLETE,commandComp);
  21.             _sList.addCommand(
  22.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler);},
  23.                 new Wait(3000),
  24.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler);},
  25.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler2);},
  26.                 new Wait(3000),
  27.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler2);},
  28.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler3);},
  29.                 new Wait(3000),
  30.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler3);}
  31.             );
  32.             _sList.execute();
  33.         }
  34.         private function commandComp(e:CommandEvent):void{
  35.             _sList.execute();
  36.         }      
  37.         private function enterFrameHandler(e:Event):void{
  38.             var low:Number=Math.random()*64;
  39.             var high:Number=Math.random()*128+128;
  40.             _bitmapdata.noise(1,low,high,1|1|1,false);
  41.         }
  42.         private function enterFrameHandler2(e:Event):void{
  43.             var low:Number=Math.random()*64;
  44.             var high:Number=Math.random()*128+128;
  45.             _bitmapdata.noise(1,low,high,4|4|4,false);
  46.         }
  47.         private function enterFrameHandler3(e:Event):void{
  48.             var low:Number=Math.random()*64;
  49.             var high:Number=Math.random()*128+128;
  50.             _bitmapdata.noise(1,low,high,2|2|1,false);
  51.         }
  52.     }
  53. }
noswf
  1. // forked from northprint's forked from: Bitmapdata.noise
  2. // forked from northprint's Bitmapdata.noise
  3. //コマンドのループby俺俺コマンド
  4. // write as3 code here..
  5. package{
  6.     import flash.display.*;
  7.     import flash.events.*;
  8.     import jp.progression.commands.*;
  9.     import jp.progression.events.*;
  10.     public class NoiseTest extends MovieClip{
  11.         private var _bitmapdata:BitmapData;
  12.         private var _bitmap:Bitmap;
  13.         public function NoiseTest(){
  14.             var sList:SerialList = new SerialList();
  15.             var loopList:SerialList = new SerialList();
  16.             _bitmapdata = new BitmapData(stage.stageWidth,stage.stageHeight,true);
  17.             _bitmap = new Bitmap(_bitmapdata);
  18.             this.addChild(_bitmap);
  19.             
  20.             loopList.addCommand(
  21.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler);},
  22.                 new Wait(3000),
  23.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler);},
  24.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler2);},
  25.                 new Wait(3000),
  26.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler2);},
  27.                 function():void{addEventListener(Event.ENTER_FRAME,enterFrameHandler3);},
  28.                 new Wait(3000),
  29.                 function():void{removeEventListener(Event.ENTER_FRAME,enterFrameHandler3);}
  30.             );
  31.             sList.addCommand(new LoopCommand(loopList));
  32.             sList.execute();
  33.         }
  34.     
  35.         private function enterFrameHandler(e:Event):void{
  36.             var low:Number=Math.random()*64;
  37.             var high:Number=Math.random()*128+128;
  38.             _bitmapdata.noise(1,low,high,1|1|1,false);
  39.         }
  40.         private function enterFrameHandler2(e:Event):void{
  41.             var low:Number=Math.random()*64;
  42.             var high:Number=Math.random()*128+128;
  43.             _bitmapdata.noise(1,low,high,4|4|4,false);
  44.         }
  45.         private function enterFrameHandler3(e:Event):void{
  46.             var low:Number=Math.random()*64;
  47.             var high:Number=Math.random()*128+128;
  48.             _bitmapdata.noise(1,low,high,2|2|1,false);
  49.         }
  50.     }
  51. }
  52. import jp.progression.commands.*;  
  53. import jp.progression.core.commands.Command;   
  54. import jp.progression.events.*;
  55. class LoopCommand extends Command{
  56.     
  57.     private var _command:Command;
  58.     public function LoopCommand(command:Command,initObject:Object = null){
  59.         super( _execute, _interrupt, initObject );
  60.         _command = command;
  61.     }
  62.     private function _execute():void{
  63.         _command.addEventListener(CommandEvent.COMMAND_COMPLETE,commandComp);
  64.         _command.execute();
  65.         executeComplete();
  66.     }
  67.     private function commandComp(e:CommandEvent):void{
  68.         _command.execute();
  69.     }  
  70.     private function _interrupt():void{
  71.         _command.removeEventListener(CommandEvent.COMMAND_COMPLETE,commandComp);
  72.         interruptComplete();
  73.     }  
  74.     public override function clone():Command{
  75.         return new LoopCommand(_command);  
  76.     }
  77. }
noswf
Get Adobe Flash Player