Timer(1000)はどう呼ばれるのか
1000のタイマーをひたすら観測するテスト
/**
* Copyright keno42 ( http://wonderfl.net/user/keno42 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/eDGF
*/
package
{
import flash.display.Sprite;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.utils.getTimer;
import flash.utils.Timer;
/**
* 1000のタイマーをひたすら観測するテスト
*/
public class TimerTest extends Sprite
{
private var t:Timer = new Timer(1000);
private var tf:TextField = new TextField();
private var first:String = "";
public function TimerTest ()
{
this.addChild( tf );
t.addEventListener(TimerEvent.TIMER, onTimer);
t.start();
}
private function onTimer(e:TimerEvent):void {
if ( first == "" ) {
first = String(getTimer());
}
tf.text = "first: " + first + "\n" + "current: " + getTimer();
}
}
}