flash on 2009-6-14

by pperon
♥0 | Line 20 | Modified 2009-06-14 03:02:46 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.text.TextField;
    public class FlashTest extends Sprite {
        
        private var textField:TextField;
        
        public function FlashTest() {
            textField = new TextField();
            addChild(textField);
            textField.text = "";
            for(var i:uint = 0; i < 20; i++)
            {
                 textField.text += randomFromRange(5, 10) + "\n";   
            }
        }
        
        private function randomFromRange(low:Number, high:Number):Number
        {
             return Math.floor(Math.random() * (high-low)) + low;   
        }
    }
}