これは単純なコードですが、解決できません..a.buttonをクリックするとタイマーが実行されますが、b.buttonをクリックしてもタイマーは実行されたままです。このタイマーを停止するには?? ありがとう(下手な英語でごめんなさい)
a.addEventListener(MouseEvent.CLICK, starts);
function starts(e:MouseEvent)
{
time(0);
}
b.addEventListener(MouseEvent.CLICK, stops);
function stops(e:MouseEvent)
{
time(1);
}
function time(cc)
{
var timer:Timer = new Timer(1000,100);
timer.addEventListener(TimerEvent.TIMER, tmer);
timer.start();
function tmer(e:TimerEvent):void
{
trace("start");
}
if(cc == 1)
{
trace("stop");
timer.stop();
timer.removeEventListener(TimerEvent.TIMER, tmer);
}
cc=0;
}