flash on 2015-6-12

by komatsu
♥0 | Line 21 | Modified 2015-06-12 09:35:04 | MIT License
play

ActionScript3 source code

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

package {

    import flash.text.TextFormat;

    import flash.text.TextField;

    import flash.display.Sprite;

    public class FlashTest extends Sprite {

        public function FlashTest() {

            // write as3 code here

            
            for(var i:int=0; i<=100; i++){
                var tf:TextField = new TextField();
    
                tf.text = "Hello world!!";
    
                tf.width = 400;//<--------------------------------------
    
                tf.x = stage.stageWidth*Math.random();
    
                tf.y = stage.stageHeight*Math.random();
    
                
    
                addChild(tf);
    
                
    
                var tformat:TextFormat = new TextFormat();
    
                tformat.size = 50*Math.random();
    
                tformat.color = 0xffffff*Math.random();
    
                //tformat.align = "center";//<--------------------------------------
    
                
    
                tf.setTextFormat(tformat);
            }
            

        }

    }

}