flash on 2013-5-22
/**
* Copyright ifrost ( http://wonderfl.net/user/ifrost )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dHve
*/
package {
import flash.display.Graphics;
import flash.text.AntiAliasType;
import flash.text.TextFormat;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.text.TextField;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public static const to:int = 82;
public var current:int;
public var text:TextField;
public function FlashTest() {
// write as3 code here..
text = new TextField();
text.width = 450;
text.height = 500
text.defaultTextFormat = new TextFormat("Arial", 230, 0x6f7072, true, null, null, null, null, "right");
current = 0;
text.text = " 0%";
var timer:Timer = new Timer(20, to+1);
timer.addEventListener(TimerEvent.TIMER, t);
addChild(text);
timer.start();
}
public function t(event:TimerEvent):void {
text.text = current + "%";
current++;
}
}
}