In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

寄付ハック当選ピッカー

Get Adobe Flash player
by fladdict 16 Feb 2011
/**
 * Copyright fladdict ( http://wonderfl.net/user/fladdict )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/vVe0
 */

package {
    import flash.events.*;
    import flash.text.TextField;
    import flash.display.Sprite;
    
    public class FlashTest extends Sprite {
        public static const MAX_NUM = 167;
        public var txt:TextField;
        
        public function FlashTest() {
            // init
            txt = new TextField();
            txt.scaleX = txt.scaleY = 4;
            txt.text = "test";
            txt.selectable = false;
            addChild(txt);
            
            addEventListener(MouseEvent.MOUSE_DOWN, downHandler, false, 0, true);
            
            downHandler(undefined);
        }
        
        public function downHandler(e:Event):void
        {
            txt.text = new String(pickNumber()+1);
        }

        
        public function pickNumber():int
        {
            return Math.floor(Math.random()*MAX_NUM);
        }

    }
}