寄付ハック当選ピッカー
/**
* 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);
}
}
}