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

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

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


FORKED
  1. // forked from butr0s's Bounce
  2. package {
  3.     import flash.display.Sprite;
  4.     [SWF(width="640", height="480", backgroundColor="0xccccff", frameRate="30")]
  5.     public class Bounce extends Sprite {
  6.         public function Bounce():void {    main = this; initialize(); }
  7.     }
  8. }
  9. import flash.display.*;
  10. import flash.events.*;
  11. const SCREEN_WIDTH:int = 640, SCREEN_HEIGHT:int = 480;
  12. var main:Sprite, g:Graphics;
  13. var collections:Array = new Array();
  14. var color:int = 0xff0000;
  15. var ticks:int = 10;
  16. var start:Collection = new Collection();
  17. function initialize():void {
  18.     g = main.graphics;
  19.     main.addEventListener(Event.ENTER_FRAME, update);
  20. }
  21. function update():void {
  22.     g.clear();
  23.     ticks++;
  24.     
  25.     if(collections.length < 5 && ticks > 2) {
  26.         ticks = 0;
  27.         var blur:Collection = new Collection();
  28.         for(var i:int = 0; i < blur.contents.length; i++) {
  29.             blur.contents[i].position.x = start.contents[i].position.x;
  30.             blur.contents[i].position.y = start.contents[i].position.y;
  31.             blur.contents[i].velocity.x = start.contents[i].velocity.x;
  32.             blur.contents[i].velocity.y = start.contents[i].velocity.y;
  33.         }
  34.         collections.push(blur);
  35.     }
  36.     
  37.     var thickness:int = 1, alpha:Number = 1;
  38.     for each(var c:Collection in collections) {
  39.         thickness += 1; alpha -= 0.0;
  40.         c.update(thickness, color, alpha);
  41.     }
  42. }
  43. class Collection {
  44.     public var contents:Array = new Array();
  45.     
  46.     public function Collection():void {
  47.         contents.push(new Point());
  48.         contents.push(new Point());
  49.         contents.push(new Point());
  50.         contents.push(new Point());
  51.     }
  52.     public function update(width:int = 3, color:int = 0xff0000, alpha:Number = 0.1):void {
  53.         // Update individual points
  54.         for each(var p:Point in contents) p.update();
  55.         
  56.         // Draw lines
  57.         g.lineStyle(width, color, alpha);
  58.         g.moveTo(contents[contents.length - 1].position.x, contents[contents.length - 1].position.y);
  59.         for each(p in contents) g.lineTo(p.position.x, p.position.y);
  60.     }
  61. }
  62. class Point {
  63.     public var position:Object = new Object;
  64.     public var velocity:Object = new Object;
  65.     
  66.     public function Point():void {
  67.         position.x = Math.random() * SCREEN_WIDTH;
  68.         position.y = Math.random() * SCREEN_HEIGHT;
  69.         velocity.x = Math.random() * 10;
  70.         velocity.y = Math.random() * 10;
  71.     }
  72.     
  73.     public function update():void {
  74.         // Move
  75.         position.x += velocity.x;
  76.         position.y += velocity.y;
  77.         
  78.         if(position.x < 0 || position.x > SCREEN_WIDTH)    velocity.x *= -1;
  79.         if(position.y < 0 || position.y > SCREEN_HEIGHT) velocity.y *= -1;
  80.     }
  81. }
noswf
  1. // forked from butr0s's Bounce
  2. package {
  3.     import flash.display.Sprite;
  4.     [SWF(width="465", height="465", backgroundColor="0x000000", frameRate="30")]
  5.     public class Bounce extends Sprite {
  6.         public function Bounce():void {    main = this; initialize(); }
  7.     }
  8. }
  9. import flash.display.*;
  10. import flash.events.*;
  11. const SCREEN_WIDTH:int = 465, SCREEN_HEIGHT:int = 465;
  12. var main:Sprite, g:Graphics;
  13. var collections:Array = new Array();
  14. var color:int = 0xffffff;
  15. var ticks:int = 0;
  16. var start:Collection = new Collection();
  17. function initialize():void {
  18.     g = main.graphics;
  19.     main.addEventListener(Event.ENTER_FRAME, update);
  20. }
  21. function update():void {
  22.     g.clear();
  23.     ticks++;
  24.     
  25.     if(collections.length < 5 && ticks > 2) {
  26.         ticks = 0;
  27.         var blur:Collection = new Collection();
  28.         for(var i:int = 0; i < blur.contents.length; i++) {
  29.             blur.contents[i].position.x = start.contents[i].position.x;
  30.             blur.contents[i].position.y = start.contents[i].position.y;
  31.             blur.contents[i].velocity.x = start.contents[i].velocity.x;
  32.             blur.contents[i].velocity.y = start.contents[i].velocity.y;
  33.         }
  34.         collections.push(blur);
  35.     }
  36.     
  37.     var thickness:int = 1, alpha:Number = 1;
  38.     for each(var c:Collection in collections) {
  39.         thickness += 1; alpha -= 0.2;
  40.         c.update(thickness, color, alpha);
  41.     }
  42. }
  43. class Collection {
  44.     public var contents:Array = new Array();
  45.     
  46.     public function Collection():void {
  47.         contents.push(new Point());
  48.         contents.push(new Point());
  49.         contents.push(new Point());
  50.         contents.push(new Point());
  51.     }
  52.     public function update(width:int = 3, color:int = 0xffffff, alpha:Number = 0.9):void {
  53.         // Update individual points
  54.         for each(var p:Point in contents) p.update();
  55.         
  56.         // Draw lines
  57.         g.lineStyle(width, color, alpha);
  58.         g.moveTo(contents[contents.length - 1].position.x, contents[contents.length - 1].position.y);
  59.         for each(p in contents) g.lineTo(p.position.x, p.position.y);
  60.     }
  61. }
  62. class Point {
  63.     public var position:Object = new Object;
  64.     public var velocity:Object = new Object;
  65.     
  66.     public function Point():void {
  67.         position.x = Math.random() * SCREEN_WIDTH;
  68.         position.y = Math.random() * SCREEN_HEIGHT;
  69.         velocity.x = Math.random() * 5;
  70.         velocity.y = Math.random() * 5;
  71.     }
  72.     
  73.     public function update():void {
  74.         // Move
  75.         position.x += velocity.x;
  76.         position.y += velocity.y;
  77.         
  78.         if(position.x < 0 || position.x > SCREEN_WIDTH)    velocity.x *= -1;
  79.         if(position.y < 0 || position.y > SCREEN_HEIGHT) velocity.y *= -1;
  80.     }
  81. }
noswf
Get Adobe Flash Player