forked from: forked from: 読み込み中っぽいもの
// forked from xor's forked from: 読み込み中っぽいもの
// forked from Susisu's 読み込み中っぽいもの
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
public class FlashTest extends Sprite {
public function FlashTest() {
var spin:Spin=new Spin();
spin.x=465/2;
spin.y=465/2;
addChild(spin);
var tf:TextField=new TextField();
var format:TextFormat=new TextFormat(null,16,0x808080,true,false,false,null,null,"center");
tf.text="読み込み中...\n(※嘘です)";
tf.setTextFormat(format);
tf.width=465;
tf.y=465/2+40;
addChild(tf);
}
}
}
import flash.display.Sprite;
import flash.display.Shape;
import flash.events.Event;
class Spin extends Sprite{
private var balls:Vector.<Shape>=new Vector.<Shape>();
private var r:Number=0;
public function Spin(){
for(var i:uint=0;i<8;i++){
var ball:Shape=new Shape();
ball.x=Math.cos(2*Math.PI/8*i)*16;
ball.y=Math.sin(2*Math.PI/8*i)*16;
ball.graphics.beginFill(0x808080);
ball.graphics.drawCircle(0,0,4);
ball.graphics.endFill();
//ball.alpha=(Math.sin(2*Math.PI/8*i-r)+1)/2;
addChild(ball);
balls.push(ball);
}
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
private function onEnterFrame(e:Event):void{
for(var i:uint=0;i<8;i++){
balls[i].alpha=(Math.sin(2*Math.PI/8*i-r)+1)/2;
}
r+=Math.PI/60;
}
}