flash on 2010-1-27
♥0 |
Line 32 |
Modified 2010-01-27 01:27:41 |
MIT License
archived:2017-03-20 12:54:30
ActionScript3 source code
/**
* Copyright hacker_9p8x8mco ( http://wonderfl.net/user/hacker_9p8x8mco )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/Anfu
*/
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.utils.Timer;
public class Anime1 extends Sprite{
public function Anime1():void{
stage.addEventListener("click",clickHandler);
}
private function clickHandler(event:MouseEvent):void{
var s:Sprite = new Sprite();
s.graphics.beginFill(Math.random() * 0x100000);
s.graphics.drawCircle(20,0,10);
s.graphics.endFill();
addChild(s);
s.scaleX = s.scaleY = 0;
var timer:Timer = new Timer(50,20);
timer.start();
timer.addEventListener("timer",function(event:Event):void{
var ratio:Number = timer.currentCount / timer.repeatCount;
s.alpha = 1 - ratio;
s.scaleX = 5 * ratio;
s.scaleY = 5 * ratio;
s.rotation = 360 * ratio;
});
timer.addEventListener("timerComplete",function(event:Event):void{
removeChild(s);
});
}
}
}