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

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

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


FORKED
  1. // forked from shapevent's Aprox 20,000 Rollovers
  2. package {
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.     import flash.geom.*;
  6.        // After the lines have finished 
  7.        // drawing, move your
  8.        // mouse around the screen
  9.     
  10.        public class ManyRollovers extends MovieClip {
  11.         private var canvas:BitmapData;
  12.         private var indexCanvas:BitmapData;
  13.         private var s:Shape;
  14.         private var lineData:Array;
  15.         private var dataIndex:int;
  16.         private var totalLines:int;
  17.         private var iterations:int;
  18.         private var linesPerIter:int;
  19.         private var xp:int;
  20.         private var yp:int;
  21.         private var stepAmt:Number;
  22.         private var halfStepAmt:Number;
  23.                public function ManyRollovers(){
  24.                   // init
  25.             [SWF(width = 500, height = 500, frameRate = 30)]
  26.             
  27.             canvas = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);
  28.             
  29.             indexCanvas = new BitmapData(stage.stage.stageWidth, stage.stageHeight, false,
  30.                                                         0xFFFFFF);
  31.             addChild(new Bitmap(canvas));
  32.             
  33.             s = new Shape();
  34.             
  35.             lineData = [];
  36.             dataIndex = 0;
  37.             
  38.             trace(0xFFFFFF - 1)
  39.             totalLines = 20000;
  40.             iterations = 9;
  41.             linesPerIter = totalLines / iterations;
  42.             
  43.             xp = stage.stageWidth / 2;
  44.             yp = stage.stageHeight / 2;
  45.             
  46.             stepAmt = 60;
  47.             halfStepAmt = stepAmt / 2;
  48.             
  49.             addEventListener(Event.ENTER_FRAME, onDraw);
  50.             
  51.             
  52.             
  53.             
  54.             
  55.                }
  56.                // private methods
  57.         private function onDraw(evt:Event):void {
  58.              if (lineData.length < totalLines){
  59.                 generateData(linesPerIter); 
  60.              }else{
  61.                 stage.quality = "high";
  62.                 addChild(s);
  63.                 s.x = 0;
  64.                 s.y = 0;
  65.                  
  66.                 removeEventListener(Event.ENTER_FRAME, onDraw);
  67.                 addEventListener(Event.ENTER_FRAME, onRun);
  68.              }
  69.         }
  70.         private function onRun(evt:Event):void {
  71.            var currentIndex:int = indexCanvas.getPixel(mouseX, mouseY);    
  72.            var currentLine:Array = lineData[currentIndex];
  73.            
  74.            s.graphics.clear();
  75.            if (currentIndex != 0xFFFFFF){
  76.                   s.graphics.lineStyle(3, 0xFF0000);
  77.                   s.graphics.moveTo(currentLine[0], currentLine[1]);
  78.                   s.graphics.lineTo(currentLine[2], currentLine[3]);  
  79.            }
  80.         }
  81.         private function generateData(num:int):void{
  82.             var rxA:int, rxB:int, ryA:int, ryB:int;    
  83.             var g:Graphics = s.graphics;
  84.             for (var i:int = 0; i<num; i++){
  85.                 rxA = xp;
  86.                 ryA = yp;
  87.                 
  88.                 xp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  89.                 yp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  90.                 
  91.                 if (xp > stage.stageWidth){
  92.                     xp = stage.stageWidth - halfStepAmt;
  93.                 }else
  94.                 if (xp < 0){
  95.                     xp = halfStepAmt;
  96.                 }
  97.                 if (yp > stage.stageHeight){
  98.                     yp = stage.stageHeight - halfStepAmt;
  99.                 }else
  100.                 if (yp < 0){
  101.                     yp = halfStepAmt;
  102.                 }
  103.                 
  104.                 rxB = xp;
  105.                 ryB = yp;
  106.                  
  107.                 lineData[dataIndex] = [rxA, ryA, rxB, ryB];                
  108.                 s.x = rxA;
  109.                 s.y = ryA;
  110.                 var endX:Number = rxB - rxA;
  111.                 var endY:Number = ryB - ryA;
  112.                 var m:Matrix = s.transform.matrix;
  113.                 g.clear();
  114.                 g.lineStyle(1, 0x000000, 0.3);
  115.         
  116.                 g.lineTo(endX, endY);
  117.                 stage.quality = "high";
  118.                 canvas.draw(s, m);
  119.                 
  120.                 g.clear();
  121.                 g.lineStyle(3, dataIndex);
  122.                 
  123.                 g.lineTo(endX, endY);
  124.                 stage.quality = "low";
  125.                 indexCanvas.draw(s, m);
  126.                 
  127.                 dataIndex++
  128.             }
  129.         }
  130.         
  131.        }
  132. }
noswf
  1. // forked from shapevent's Aprox 20,000 Rollovers
  2. package {
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.     import flash.geom.*;
  6.        // After the lines have finished 
  7.        // drawing, move your
  8.        // mouse around the screen
  9.     
  10.        public class ManyRollovers extends MovieClip {
  11.         private var canvas:BitmapData;
  12.         private var indexCanvas:BitmapData;
  13.         private var s:Shape;
  14.         private var lineData:Array;
  15.         private var dataIndex:int;
  16.         private var totalLines:int;
  17.         private var iterations:int;
  18.         private var linesPerIter:int;
  19.         private var xp:int;
  20.         private var yp:int;
  21.         private var stepAmt:Number;
  22.         private var halfStepAmt:Number;
  23.                public function ManyRollovers(){
  24.                   // init
  25.             [SWF(width = 500, height = 500, frameRate = 30)]
  26.             
  27.             canvas = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);
  28.             
  29.             indexCanvas = new BitmapData(stage.stage.stageWidth, stage.stageHeight, false,
  30.                                                         0xFFFFFF);
  31.             addChild(new Bitmap(canvas));
  32.             
  33.             s = new Shape();
  34.             
  35.             lineData = [];
  36.             dataIndex = 0;
  37.             
  38.             trace(0xFFFFFF - 1)
  39.             totalLines = 20000;
  40.             iterations = 9;
  41.             linesPerIter = totalLines / iterations;
  42.             
  43.             xp = stage.stageWidth / 2;
  44.             yp = stage.stageHeight / 2;
  45.             
  46.             stepAmt = 60;
  47.             halfStepAmt = stepAmt / 2;
  48.             
  49.             addEventListener(Event.ENTER_FRAME, onDraw);
  50.             
  51.             
  52.             
  53.             
  54.             
  55.                }
  56.                // private methods
  57.         private function onDraw(evt:Event):void {
  58.              if (lineData.length < totalLines){
  59.                 generateData(linesPerIter); 
  60.              }else{
  61.                 stage.quality = "high";
  62.                 addChild(s);
  63.                 s.x = 0;
  64.                 s.y = 0;
  65.                  
  66.                 removeEventListener(Event.ENTER_FRAME, onDraw);
  67.                 addEventListener(Event.ENTER_FRAME, onRun);
  68.              }
  69.         }
  70.         private function onRun(evt:Event):void {
  71.            var currentIndex:int = indexCanvas.getPixel(mouseX, mouseY);    
  72.            var currentLine:Array = lineData[currentIndex];
  73.            
  74.            s.graphics.clear();
  75.            if (currentIndex != 0xFFFFFF){
  76.                   s.graphics.lineStyle(3, 0xFF0000);
  77.                   s.graphics.moveTo(currentLine[0], currentLine[1]);
  78.                   s.graphics.lineTo(currentLine[2], currentLine[3]);  
  79.            }
  80.         }
  81.         private function generateData(num:int):void{
  82.             var rxA:int, rxB:int, ryA:int, ryB:int;    
  83.             var g:Graphics = s.graphics;
  84.             for (var i:int = 0; i<num; i++){
  85.                 rxA = xp;
  86.                 ryA = yp;
  87.                 
  88.                 xp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  89.                 yp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  90.                 
  91.                 if (xp > stage.stageWidth){
  92.                     xp = stage.stageWidth - halfStepAmt;
  93.                 }else
  94.                 if (xp < 0){
  95.                     xp = halfStepAmt;
  96.                 }
  97.                 if (yp > stage.stageHeight){
  98.                     yp = stage.stageHeight - halfStepAmt;
  99.                 }else
  100.                 if (yp < 0){
  101.                     yp = halfStepAmt;
  102.                 }
  103.                 
  104.                 rxB = xp;
  105.                 ryB = yp;
  106.                  
  107.                 lineData[dataIndex] = [rxA, ryA, rxB, ryB];                
  108.                 s.x = rxA;
  109.                 s.y = ryA;
  110.                 var endX:Number = rxB - rxA;
  111.                 var endY:Number = ryB - ryA;
  112.                 var m:Matrix = s.transform.matrix;
  113.                 g.clear();
  114.                 g.lineStyle(1, 0x999999, 0.3);
  115.         
  116.                 g.lineTo(endX, endY);
  117.                 stage.quality = "high";
  118.                 canvas.draw(s, m);
  119.                 
  120.                 g.clear();
  121.                 g.lineStyle(3, dataIndex);
  122.                 
  123.                 g.lineTo(endX, endY);
  124.                 stage.quality = "low";
  125.                 indexCanvas.draw(s, m);
  126.                 
  127.                 dataIndex++
  128.             }
  129.         }
  130.         
  131.        }
  132. }
noswf
  1. // forked from shapevent's Aprox 20,000 Rollovers
  2. package {
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.     import flash.geom.*;
  6.        // After the lines have finished 
  7.        // drawing, move your
  8.        // mouse around the screen
  9.     
  10.        public class ManyRollovers extends MovieClip {
  11.         private var canvas:BitmapData;
  12.         private var indexCanvas:BitmapData;
  13.         private var s:Shape;
  14.         private var lineData:Array;
  15.         private var dataIndex:int;
  16.         private var totalLines:int;
  17.         private var iterations:int;
  18.         private var linesPerIter:int;
  19.         private var xp:int;
  20.         private var yp:int;
  21.         private var stepAmt:Number;
  22.         private var halfStepAmt:Number;
  23.                public function ManyRollovers(){
  24.                   // init
  25.             [SWF(width = 750, height = 500, frameRate = 40)]
  26.             
  27.             canvas = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFF0);
  28.             
  29.             indexCanvas = new BitmapData(stage.stage.stageWidth, stage.stageHeight, false,
  30.                                                         0xFFFFFF);
  31.             addChild(new Bitmap(canvas));
  32.             
  33.             s = new Shape();
  34.             
  35.             lineData = [];
  36.             dataIndex = 0;
  37.             
  38.             trace(0xFFFFFF - 1)
  39.             totalLines = 20000;
  40.             iterations = 9;
  41.             linesPerIter = totalLines / iterations;
  42.             
  43.             xp = stage.stageWidth / 2;
  44.             yp = stage.stageHeight / 2;
  45.             
  46.             stepAmt = 60;
  47.             halfStepAmt = stepAmt / 2;
  48.             
  49.             addEventListener(Event.ENTER_FRAME, onDraw);
  50.             
  51.             
  52.             
  53.             
  54.             
  55.                }
  56.                // private methods
  57.         private function onDraw(evt:Event):void {
  58.              if (lineData.length < totalLines){
  59.                 generateData(linesPerIter); 
  60.              }else{
  61.                 stage.quality = "high";
  62.                 addChild(s);
  63.                 s.x = 0;
  64.                 s.y = 0;
  65.                  
  66.                 removeEventListener(Event.ENTER_FRAME, onDraw);
  67.                 addEventListener(Event.ENTER_FRAME, onRun);
  68.              }
  69.         }
  70.         private function onRun(evt:Event):void {
  71.            var currentIndex:int = indexCanvas.getPixel(mouseX, mouseY);    
  72.            var currentLine:Array = lineData[currentIndex];
  73.            
  74.            s.graphics.clear();
  75.            if (currentIndex != 0xFFFFFF){
  76.                   s.graphics.lineStyle(3, 0xFF0000);
  77.                   s.graphics.moveTo(currentLine[0], currentLine[1]);
  78.                   s.graphics.lineTo(currentLine[2], currentLine[3]);  
  79.            }
  80.         }
  81.         private function generateData(num:int):void{
  82.             var rxA:int, rxB:int, ryA:int, ryB:int;    
  83.             var g:Graphics = s.graphics;
  84.             for (var i:int = 0; i<num; i++){
  85.                 rxA = xp;
  86.                 ryA = yp;
  87.                 
  88.                 xp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  89.                 yp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  90.                 
  91.                 if (xp > stage.stageWidth){
  92.                     xp = stage.stageWidth - halfStepAmt;
  93.                 }else
  94.                 if (xp < 0){
  95.                     xp = halfStepAmt;
  96.                 }
  97.                 if (yp > stage.stageHeight){
  98.                     yp = stage.stageHeight - halfStepAmt;
  99.                 }else
  100.                 if (yp < 0){
  101.                     yp = halfStepAmt;
  102.                 }
  103.                 
  104.                 rxB = xp;
  105.                 ryB = yp;
  106.                  
  107.                 lineData[dataIndex] = [rxA, ryA, rxB, ryB];                
  108.                 s.x = rxA;
  109.                 s.y = ryA;
  110.                 var endX:Number = rxB - rxA;
  111.                 var endY:Number = ryB - ryA;
  112.                 var m:Matrix = s.transform.matrix;
  113.                 g.clear();
  114.                 g.lineStyle(1, 0x000000, 0.3);
  115.         
  116.                 g.lineTo(endX, endY);
  117.                 stage.quality = "high";
  118.                 canvas.draw(s, m);
  119.                 
  120.                 g.clear();
  121.                 g.lineStyle(3, dataIndex);
  122.                 
  123.                 g.lineTo(endX, endY);
  124.                 stage.quality = "low";
  125.                 indexCanvas.draw(s, m);
  126.                 
  127.                 dataIndex++
  128.             }
  129.         }
  130.         
  131.        }
  132. }
noswf
  1. // forked from shapevent's Aprox 20,000 Rollovers
  2. package {
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.     import flash.geom.*;
  6.        // After the lines have finished 
  7.        // drawing, move your
  8.        // mouse around the screen
  9.     
  10.        public class ManyRollovers extends MovieClip {
  11.         private var canvas:BitmapData;
  12.         private var indexCanvas:BitmapData;
  13.         private var s:Shape;
  14.         private var lineData:Array;
  15.         private var dataIndex:int;
  16.         private var totalLines:int;
  17.         private var iterations:int;
  18.         private var linesPerIter:int;
  19.         private var xp:int;
  20.         private var yp:int;
  21.         private var stepAmt:Number;
  22.         private var halfStepAmt:Number;
  23.                public function ManyRollovers(){
  24.                   // init
  25.             [SWF(width = 500, height = 500, frameRate = 30)]
  26.             
  27.             canvas = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);
  28.             
  29.             indexCanvas = new BitmapData(stage.stage.stageWidth, stage.stageHeight, false,
  30.                                                         0xFFFFFF);
  31.             addChild(new Bitmap(canvas));
  32.             
  33.             s = new Shape();
  34.             
  35.             lineData = [];
  36.             dataIndex = 0;
  37.             
  38.             trace(0xFFFFFF - 1)
  39.             totalLines = 20000;
  40.             iterations = 9;
  41.             linesPerIter = totalLines / iterations;
  42.             
  43.             xp = stage.stageWidth / 2;
  44.             yp = stage.stageHeight / 2;
  45.             
  46.             stepAmt = 60;
  47.             halfStepAmt = stepAmt / 2;
  48.             
  49.             addEventListener(Event.ENTER_FRAME, onDraw);
  50.             
  51.             
  52.             
  53.             
  54.             
  55.                }
  56.                // private methods
  57.         private function onDraw(evt:Event):void {
  58.              if (lineData.length < totalLines){
  59.                 generateData(linesPerIter); 
  60.              }else{
  61.                 stage.quality = "high";
  62.                 addChild(s);
  63.                 s.x = 0;
  64.                 s.y = 0;
  65.                  
  66.                 removeEventListener(Event.ENTER_FRAME, onDraw);
  67.                 addEventListener(Event.ENTER_FRAME, onRun);
  68.              }
  69.         }
  70.         private function onRun(evt:Event):void {
  71.            var currentIndex:int = indexCanvas.getPixel(mouseX, mouseY);    
  72.            var currentLine:Array = lineData[currentIndex];
  73.            
  74.            s.graphics.clear();
  75.            if (currentIndex != 0xFFFFFF){
  76.                   s.graphics.lineStyle(3, 0xFF0000);
  77.                   s.graphics.moveTo(currentLine[0], currentLine[1]);
  78.                   s.graphics.lineTo(currentLine[2], currentLine[3]);  
  79.            }
  80.         }
  81.         private function generateData(num:int):void{
  82.             var rxA:int, rxB:int, ryA:int, ryB:int;    
  83.             var g:Graphics = s.graphics;
  84.             for (var i:int = 0; i<num; i++){
  85.                 rxA = xp;
  86.                 ryA = yp;
  87.                 
  88.                 xp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  89.                 yp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  90.                 
  91.                 if (xp > stage.stageWidth){
  92.                     xp = stage.stageWidth - halfStepAmt;
  93.                 }else
  94.                 if (xp < 0){
  95.                     xp = halfStepAmt;
  96.                 }
  97.                 if (yp > stage.stageHeight){
  98.                     yp = stage.stageHeight - halfStepAmt;
  99.                 }else
  100.                 if (yp < 0){
  101.                     yp = halfStepAmt;
  102.                 }
  103.                 
  104.                 rxB = xp;
  105.                 ryB = yp;
  106.                  
  107.                 lineData[dataIndex] = [rxA, ryA, rxB, ryB];                
  108.                 s.x = rxA;
  109.                 s.y = ryA;
  110.                 var endX:Number = rxB - rxA;
  111.                 var endY:Number = ryB - ryA;
  112.                 var m:Matrix = s.transform.matrix;
  113.                 g.clear();
  114.                 g.lineStyle(1, 0x000000, 0.3);
  115.         
  116.                 g.lineTo(endX, endY);
  117.                 stage.quality = "high";
  118.                 canvas.draw(s, m);
  119.                 
  120.                 g.clear();
  121.                 g.lineStyle(3, dataIndex);
  122.                 
  123.                 g.lineTo(endX, endY);
  124.                 stage.quality = "low";
  125.                 indexCanvas.draw(s, m);
  126.                 
  127.                 dataIndex++
  128.             }
  129.         }
  130.         
  131.        }
  132. }
noswf
  1. // forked from shapevent's Aprox 20,000 Rollovers
  2. package {
  3.     import flash.display.*;
  4.     import flash.events.*;
  5.     import flash.geom.*;
  6.        // After the lines have finished 
  7.        // drawing, move your
  8.        // mouse around the screen
  9.     
  10.        public class ManyRollovers extends MovieClip {
  11.         private var canvas:BitmapData;
  12.         private var indexCanvas:BitmapData;
  13.         private var s:Shape;
  14.         private var lineData:Array;
  15.         private var dataIndex:int;
  16.         private var totalLines:int;
  17.         private var iterations:int;
  18.         private var linesPerIter:int;
  19.         private var xp:int;
  20.         private var yp:int;
  21.         private var stepAmt:Number;
  22.         private var halfStepAmt:Number;
  23.                public function ManyRollovers(){
  24.                   // init
  25.             [SWF(width = 500, height = 500, frameRate = 30)]
  26.             
  27.             canvas = new BitmapData(stage.stageWidth,stage.stageHeight,false, 0xFFFFFF);
  28.             
  29.             indexCanvas = new BitmapData(stage.stage.stageWidth, stage.stageHeight, false,
  30.                                                         0xFFFFFF);
  31.             addChild(new Bitmap(canvas));
  32.             
  33.             s = new Shape();
  34.             
  35.             lineData = [];
  36.             dataIndex = 0;
  37.             
  38.             trace(0xFFFFFF - 1)
  39.             totalLines = 20000;
  40.             iterations = 9;
  41.             linesPerIter = totalLines / iterations;
  42.             
  43.             xp = stage.stageWidth / 2;
  44.             yp = stage.stageHeight / 2;
  45.             
  46.             stepAmt = 60;
  47.             halfStepAmt = stepAmt / 2;
  48.             
  49.             addEventListener(Event.ENTER_FRAME, onDraw);
  50.             
  51.             
  52.             
  53.             
  54.             
  55.                }
  56.                // private methods
  57.         private function onDraw(evt:Event):void {
  58.              if (lineData.length < totalLines){
  59.                 generateData(linesPerIter); 
  60.              }else{
  61.                 stage.quality = "high";
  62.                 addChild(s);
  63.                 s.x = 0;
  64.                 s.y = 0;
  65.                  
  66.                 removeEventListener(Event.ENTER_FRAME, onDraw);
  67.                 addEventListener(Event.ENTER_FRAME, onRun);
  68.              }
  69.         }
  70.         private function onRun(evt:Event):void {
  71.            var currentIndex:int = indexCanvas.getPixel(mouseX, mouseY);    
  72.            var currentLine:Array = lineData[currentIndex];
  73.            
  74.            s.graphics.clear();
  75.            if (currentIndex != 0xFFFFFF){
  76.                   s.graphics.lineStyle(3, 0xFF0000);
  77.                   s.graphics.moveTo(currentLine[0], currentLine[1]);
  78.                   s.graphics.lineTo(currentLine[2], currentLine[3]);  
  79.            }
  80.         }
  81.         private function generateData(num:int):void{
  82.             var rxA:int, rxB:int, ryA:int, ryB:int;    
  83.             var g:Graphics = s.graphics;
  84.             for (var i:int = 0; i<num; i++){
  85.                 rxA = xp;
  86.                 ryA = yp;
  87.                 
  88.                 xp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  89.                 yp += Math.round(Math.random() * stepAmt) - halfStepAmt;
  90.                 
  91.                 if (xp > stage.stageWidth){
  92.                     xp = stage.stageWidth - halfStepAmt;
  93.                 }else
  94.                 if (xp < 0){
  95.                     xp = halfStepAmt;
  96.                 }
  97.                 if (yp > stage.stageHeight){
  98.                     yp = stage.stageHeight - halfStepAmt;
  99.                 }else
  100.                 if (yp < 0){
  101.                     yp = halfStepAmt;
  102.                 }
  103.                 
  104.                 rxB = xp;
  105.                 ryB = yp;
  106.                  
  107.                 lineData[dataIndex] = [rxA, ryA, rxB, ryB];                
  108.                 s.x = rxA;
  109.                 s.y = ryA;
  110.                 var endX:Number = rxB - rxA;
  111.                 var endY:Number = ryB - ryA;
  112.                 var m:Matrix = s.transform.matrix;
  113.                 g.clear();
  114.                 g.lineStyle(1, 0x000000, 0.3);
  115.         
  116.                 g.lineTo(endX, endY);
  117.                 stage.quality = "high";
  118.                 canvas.draw(s, m);
  119.                 
  120.                 g.clear();
  121.                 g.lineStyle(3, dataIndex);
  122.                 
  123.                 g.lineTo(endX, endY);
  124.                 stage.quality = "low";
  125.                 indexCanvas.draw(s, m);
  126.                 
  127.                 dataIndex++
  128.             }
  129.         }
  130.         
  131.        }
  132. }
noswf
Get Adobe Flash Player