From: Richard K. <ric...@us...> - 2005-05-17 00:47:09
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15276/test Modified Files: ASTestTimer.as Log Message: use userInfo for state Index: ASTestTimer.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestTimer.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestTimer.as 16 May 2005 03:08:55 -0000 1.1 --- ASTestTimer.as 16 May 2005 05:04:25 -0000 1.2 *************** *** 33,38 **** class org.actionstep.test.ASTestTimer { - private var m_count:Number; - public static function test() { var tmp = new ASTestTimer(); --- 33,36 ---- *************** *** 40,48 **** public function ASTestTimer() { - m_count = 0; var startDate:Date = new Date(); startDate.setTime(startDate.getTime()+6000); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(5, this, "once", {foo:"bar"}, false); ! (new NSTimer()).initWithFireDateIntervalTargetSelectorUserInfoRepeats(startDate, 1, this, "repeater", {bar:"foo"}, true); } --- 38,45 ---- public function ASTestTimer() { var startDate:Date = new Date(); startDate.setTime(startDate.getTime()+6000); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(5, this, "once", {foo:"bar"}, false); ! (new NSTimer()).initWithFireDateIntervalTargetSelectorUserInfoRepeats(startDate, 1, this, "repeater", {count:0}, true); } *************** *** 52,58 **** public function repeater(timer:NSTimer) { ! TRACE(timer.userInfo().bar); ! m_count++; ! if (m_count == 4) { timer.invalidate(); } --- 49,55 ---- public function repeater(timer:NSTimer) { ! TRACE(timer.userInfo().count); ! timer.userInfo().count++; ! if (timer.userInfo().count == 4) { timer.invalidate(); } |