forked from : minon's forked from: Blur Circle [diff(4)]

embed

  1. // forked from minon's forked from: Blur Circle
  2. // forked from ll_koba_ll's Blur Circle
  3. // write as3 code here..
  4. package
  5. {    
  6.     import flash.display.*;
  7.     import flash.events.*;
  8.     import flash.geom.*;
  9.     import flash.filters.*;
  10.     // なぜかクリックしないと描画されない>< 
  11.     // -> 別のマシンだと動いた
  12.     [SWF(frameRate="60", backgroundColor="#000000")]
  13.      /** 
  14.       *  
  15.       * @author ll_koba_ll (RAWHIDE.)
  16.       */  
  17.     public class Rotationlight extends Sprite
  18.     {
  19.         private var blur:BlurFilter;
  20.         private var container:Sprite;
  21.         private var source:Sprite;
  22.         private var bmpd:BitmapData;
  23.         public function Rotationlight()
  24.         {
  25.             stage.scaleMode = StageScaleMode.NO_SCALE;
  26.             stage.align = StageAlign.TOP_LEFT;
  27.             stage.quality = StageQuality.LOW;            
  28.             init();            
  29.             addEventListener(Event.ENTER_FRAME, update);
  30.         }
  31.         private function init():void
  32.         {
  33.             trace(stage.stageWidth)
  34.             blur = new BlurFilter(1,5);            
  35.             bmpd = new BitmapData(500500true, 0x00FFFFFF);
  36.             container = new Sprite();
  37.             source = new Sprite();
  38.             addChild(new Bitmap(bmpd));
  39.             container.addChild(source);
  40.             drawSource();
  41.             
  42.         }
  43.         private function drawSource( xx:Number = 4, yy:Number = 4 ):void {
  44.             if ( xx > 100 ) xx = 100;
  45.             if ( yy > 100 ) yy = 100;
  46.             with(source.graphics)
  47.             {
  48.                 clear();
  49.                 beginFill( Math.random() * 0xFFFFFF,  Math.random()*1);
  50.                 drawCircle(0,0,(xx>yy)?xx:yy*2.5);
  51.                 endFill();
  52.             }
  53.         }
  54.         private function update(e:Event = null):void
  55.         {
  56.             bmpd.draw(container, nullnull, BlendMode.DIFFERENCE );
  57.             bmpd.applyFilter(bmpd, bmpd.rect, new Point(), blur);
  58.             drawSource( Math.abs(source.x - mouseX), Math.abs(source.y - mouseY) );
  59.             source.x = mouseX;
  60.             source.y = mouseY;
  61.         }
  62.          
  63.     }
  64. }
flash swf thumbnail play
FORKED
  1. // forked from ll_koba_ll's forked from: forked from: Blur Circle
  2. // forked from minon's forked from: Blur Circle
  3. // forked from ll_koba_ll's Blur Circle
  4. // write as3 code here..
  5. package
  6. {    
  7.     import flash.display.*;
  8.     import flash.events.*;
  9.     import flash.geom.*;
  10.     import flash.filters.*;
  11.     // なぜかクリックしないと描画されない>< 
  12.     // -> 別のマシンだと動いた
  13.     [SWF(frameRate="60", backgroundColor="#000000")]
  14.      /** 
  15.       *  
  16.       * @author ll_koba_ll (RAWHIDE.)
  17.       */  
  18.     public class Rotationlight extends Sprite
  19.     {
  20.         private var blur:BlurFilter;
  21.         private var container:Sprite;
  22.         private var source:Sprite;
  23.         private var bmpd:BitmapData;
  24.         public function Rotationlight()
  25.         {
  26.             stage.scaleMode = StageScaleMode.NO_SCALE;
  27.             stage.align = StageAlign.TOP_LEFT;
  28.             stage.quality = StageQuality.LOW;            
  29.             init();            
  30.             addEventListener(Event.ENTER_FRAME, update);
  31.         }
  32.         private function init():void
  33.         {
  34.             trace(stage.stageWidth)
  35.             blur = new BlurFilter(1,5);            
  36.             bmpd = new BitmapData(500500true, 0x00FFFFFF);
  37.             container = new Sprite();
  38.             source = new Sprite();
  39.             addChild(new Bitmap(bmpd));
  40.             container.addChild(source);
  41.             drawSource();
  42.             
  43.         }
  44.         private function drawSource( xx:Number = 4, yy:Number = 4 ):void {
  45.             if ( xx > 100 ) xx = 100;
  46.             if ( yy > 100 ) yy = 100;
  47.             with(source.graphics)
  48.             {
  49.                 clear();
  50.                 beginFill( Math.random() * 0xFFFFFF,  Math.random()*1);
  51.                 drawCircle(0,0,(xx>yy)?xx:yy*2.5);
  52.                 endFill();
  53.             }
  54.         }
  55.         private function update(e:Event = null):void
  56.         {
  57.             bmpd.draw(container, nullnull, BlendMode.DIFFERENCE );
  58.             bmpd.applyFilter(bmpd, bmpd.rect, new Point(), blur);
  59.             drawSource( Math.abs(source.x - mouseX), Math.abs(source.y - mouseY) );
  60.             source.x = mouseX;
  61.             source.y = mouseY;
  62.         }
  63.          
  64.     }
  65. }
noswf
Get Adobe Flash Player