forked from: Bubbles
(・x・)ノ
// forked from el_falcon's Bubbles
/*
(・x・)ノ
*/
package {
import flash.display.Sprite;
import flash.events.*;
public function bubble extends Sprite {
private var shapes:Array = [];
public function bubble() {
for(var i:uint = 0; i < 300; i++) {
var s:Shape = new Shape();
addChild(s);
}
}
}
}
/*
package {
import flash.display.*;
import flash.events.*;
public class FlashTest extends Sprite {
private var shapes:Array = [];
public function FlashTest() {
// write as3 code here..
for(var i:uint=0; i<300; i++) {
var s:Shape = new Shape();
addChild(s);
var g:Graphics = s.graphics;
g.lineStyle(Math.round(Math.random()*20), Math.round(Math.random()*0xffffff));
var radius:Number = Math.round(Math.random()*80);
g.drawCircle(0, 0, radius);
s.x = Math.round(Math.random()*stage.width);
s.y = Math.round(Math.random()*stage.height);
s.alpha = (81 - radius) / 85;
s.cacheAsBitmap = true;
shapes.push({shape: s, speed: (81 - radius)/20});
}
stage.addEventListener(Event.ENTER_FRAME, move);
}
private function move (e:Event):void {
for(var i:uint = 0; i<shapes.length; i++) {
var s:Object = shapes[i];
s.shape.y -= s.speed;
if(s.shape.y + s.shape.height < 0) s.shape.y = stage.stageHeight + 50;
}
}
}
}
*/