forked from: earth
Sprite 遅いのどうしたらいいんだろ
// forked from asannou's earth
// forked from hacker_cztbzu4g's circles
// Sprite 遅いのどうしたらいいんだろ
package {
import flash.display.*;
import flash.events.*;
[SWF(width=465, height=465, frameRate=24, backgroundColor=0x0000FF)]
public class circle extends Sprite {
public function circle() {
addEventListener(
Event.ENTER_FRAME,
function (e :Event) :void {
var g :Graphics = graphics;
draw(g, Math.random() < 0.5 ? 0x00FF00 : 0x0000BB);
}
);
}
private function draw(g :Graphics, color :int) :void {
g.beginFill(color, 0.1);
g.drawCircle(
-50 + Math.random() * 300,
-50 + Math.random() * 300,
Math.random() * 150
);
g.endFill();
}
}
}