flash on 2012-2-29

by hacker_tmbt9fl2
♥0 | Line 23 | Modified 2012-02-29 14:14:39 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.Sprite;
    
    [SWF(width=480, height=480, frameRate=30)]
    public class FlashTest extends Sprite {
        
        private var _arr:Array = ["hoge", "bar", "foo", "moja", "fuga"];
        
        public function FlashTest() {
            // write as3 code here..
            var txt:TextField = new TextField();
            var fmt:TextFormat = new TextFormat("_sans", 14, 0x000000);
            txt.defaultTextFormat = fmt;
            txt.width = stage.stageWidth;
            txt.wordWrap = true;
            addChild(txt);
            for(var i:int = 0; i < 200; i++) {
                var rnd:int = int(Math.random() * _arr.length);
                txt.appendText(_arr[rnd]);
                //txt.appendText(String(int(Math.random()*10)));
                if(i < 199) txt.appendText(", ");
            }
            txt.height = stage.stageHeight;

        }
    }
}