時間の練習
♥0 |
Line 19 |
Modified 2012-05-24 13:07:42 |
MIT License
archived:2017-03-20 04:46:10
ActionScript3 source code
/**
* Copyright figma000 ( http://wonderfl.net/user/figma000 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/vbvz
*/
package {
import flash.display.*;
import flash.events.*;
import flash.text.TextField
import flash.utils.*;
[SWF(width=465, height=465, backgroundColor=0x000000)]
public class FlashTest extends Sprite {
// テキストフィールドオブジェクトを作成する
public var text_field:TextField = new TextField();
/*
// 表示リストに登録する
text_field.border = true; // 枠を表示する
text_field.x = 130; // x 座標
text_field.y = 100; // y 座標
text_field.width = 200; // 幅
text_field.height = 20; // 高さ
*/
public function FlashTest() {
//タイマーの追加
var timer:Timer = new Timer(100, 0);
timer.addEventListener(TimerEvent.TIMER, onTick);
timer.start();
// タイマー停止
//timer.stop();
}
//タイマーイベントの処理
private function onTick(evt:TimerEvent):void {
stage.addChild(text_field);
text_field.text = "Time "+int(getTimer()/1000)+" second";
}
}
}