ナベアツ
package
{
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.utils.Timer;
import flash.events.TimerEvent;
[SWF(width="400", height="400", backgroundColor="0xFFFFFF", frameRate="12")]
public class Index extends MovieClip
{
private const W:uint=400;
private const H:uint=400;
private const C_X:uint=W*0.5;
private const C_Y:uint=H*0.5;
private const STR1:String=" イ三三三三 \\n /イニニニニ\ヽ\ゝ_\n /イニニニニニ\\V/彡\、\n |三ニ>───、\V//彡\ヽヽ\n |三ニ|  ̄ \\ヽ|\n ハ三シ∠ミヽ, \ミ l\n {!レ/ ミゝ.,_ ∠三ゝ |ミ l\n";
private const STR2:String=" | レ 彡ヽ`'ゝ f=・xミ; |ミ/\n '┤ ノ i `'' /}\n l ーイ⌒(、 ':i / / サァン!\n | 《三ヲ`7≦ 〃\n ト、 斤  ̄`''キ≧ /´\n <| 丶 ヽニ--ソ'\" /\n ノ| \ \  ̄ /\\n";
private const STR3:String=" / l / ヽ、ヽミ _彡'´.〉 /\\n __/ .ト、ヽ i | / |. \_";
private var saxanTf:TextField;
private var centerTf:TextField;
private var count:uint=0;
private var resetTimer:Timer;
public function Index():void
{
centerTf = new TextField();
centerTf.defaultTextFormat = new TextFormat(null, 72, 0x000000, null, null, null, null, null, "center");
centerTf.text= "START";
centerTf.width = W;
centerTf.height = centerTf.textHeight+5;
centerTf.y = C_Y - centerTf.height*0.5;
addChild(centerTf);
saxanTf = new TextField();
saxanTf.defaultTextFormat = new TextFormat("_等幅", 12, 0x000000);
saxanTf.text= STR1 + STR2 + STR3;
saxanTf.width = saxanTf.textWidth+5;
saxanTf.height = saxanTf.textHeight+5;
saxanTf.visible=false;
saxanTf.x = C_X - saxanTf.width*0.5;
saxanTf.y = C_Y - saxanTf.height*0.5;
addChild(saxanTf);
resetTimer = new Timer(700, 1);
resetTimer.addEventListener(TimerEvent.TIMER, resetTf);
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
}
private function onTimer(tEvt:TimerEvent):void
{
++count;
if(count >= uint.MAX_VALUE){ count=1; }
centerTf.text = ""+count;
if( isThree() ){
centerTf.y = 5;
saxanTf.visible = true;
resetTimer.start();
}
else{
centerTf.y = C_Y - centerTf.height*0.5;
saxanTf.visible = false;
}
}
private function resetTf(tEvt:TimerEvent):void
{
centerTf.y = C_Y - centerTf.height*0.5;
saxanTf.visible = false;
}
private function isThree():Boolean
{
var res:Boolean=false;
var str:String = count.toString();
if( (count % 3==0) || (str.indexOf("3")>=0) ){ res = true; }
return res;
}
}
}