text and timer
♥0 |
Line 38 |
Modified 2011-01-12 06:19:58 |
MIT License
archived:2017-03-20 03:05:41
ActionScript3 source code
/**
* Copyright Highly ( http://wonderfl.net/user/Highly )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/maYn
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.events.Event;
public class FlashTest extends Sprite {
public function FlashTest() {
var ti:Timer = new Timer(20,0);
ti.addEventListener(TimerEvent.TIMER,tmr);
ti.start();
var i:int=0;
var a:Array = [];
while(i<10){
a.push(i);
++i;
}
function tmr(e:TimerEvent):void{
a.push(i);
out1.appendText( "\n"+a[i]);
++i;
if(out1.getLineText(29)==i-1+""){
out1.text=i+"";
}
}
var out1:TextField = new TextField();
out1.x=0;
out1.y=0;
out1.selectable = false;
out1.multiline = true;
out1.wordWrap = true;
out1.width = stage.stageWidth;
out1.height = stage.stageHeight;
out1.text = "I'm Gay";
addChild(out1);
}
}
}