2010-03-17_1

by Kaede
♥0 | Line 28 | Modified 2010-03-17 01:03:37 | MIT License
play

ActionScript3 source code

/**
 * Copyright Kaede ( http://wonderfl.net/user/Kaede )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/miDf
 */

package {
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
    import flash.display.Sprite;
    import flash.utils.getTimer;
    public class FlashTest extends Sprite {
    	
    		private var n:int = 1000;
    		private var strs:Array = ["a","b","c","d","e","f","g","h"];
        public function FlashTest() {
            var nt:int = getTimer();

			example();
			
			var result:int = getTimer()-nt;

			var reTf:TextField = addChild(new TextField) as TextField;
			reTf.text = "resultTime = "+(result).toString()
			reTf.y = 425
			
        }
        
        //通常の
        private function example():void{
    	    		for(var i:int;i<n;i++){
				var tf:TextField = new TextField();
				tf.autoSize = TextFieldAutoSize.LEFT;
				tf.text = strs[Math.floor(Math.random()*strs.length)];
				tf.x = 10*(i%50);
				tf.y = 20*Math.floor(i/50)
				addChild(tf)
			}
        }
    }
}

Forked