我有一个计时器警报:计时器警报 - 修正
private var cheat:Timer;
private function init():void {
cheat = new Timer(2000, 1);
cheat.addEventListener(TimerEvent.TIMER_COMPLETE, cheatProtection);
}
private function showAlert():void {
cheat.reset();
cheat.start();
}
private function alrt_close(evt:CloseEvent):void {
cheat.stop();
}
private function cheatProtection(evt:TimerEvent):void {
Alert.show("Text", "Label", Alert.OK, this, alrt_close);
}
所以,我做的是我叫出来showAlert(),但警报(cheatProtection功能)不会发生。哪里不对?
感谢,颜
你是在你调用类的地方调用的init(),对不对? – 2010-08-31 20:19:27
嗯..我在做: rollOut =“showAlert()” 东西不见了? – Yan 2010-08-31 20:48:50
对,但是你在某个时候明确地调用了init()吗?如果没有,你的计时器永远不会被创建。 (除非init()被自动调用;它已经有一段时间了,因为我创建了一个Flex对象。) – 2010-08-31 21:03:05