flash on 2011-7-24

by points
...
@author
♥0 | Line 34 | Modified 2011-07-24 15:04:48 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.TextField;

    /**
     * ...
     * @author
     */
    public class NewClass extends Sprite {
        private var count:uint = 0;
        private var num:uint = 1;
        private var tf:TextField;

        public function NewClass(){
            tf = new TextField();
            tf.height = 400;
            tf.border = true;
            addChild(tf);
            addEventListener(Event.ENTER_FRAME, onEnter);
        }

        private function onEnter(e:Event):void {
            if (count % 20 == 0){
                var str:String;
                if (num % 15 == 0){
                    str = "fizzbuzz";
                } else if (num % 3 == 0){
                    str = "fizz";
                } else if (num % 5 == 0){
                    str = "buzz";
                } else {
                    str = String(num);
                }
                tf.text = "\n" + str + tf.text;
                num++
            }
            count++;
        }

    }

}