Skip to main content
Known Participant
June 26, 2011
Answered

iOS Timer Problem - Best practice?

  • June 26, 2011
  • 2 replies
  • 1166 views

Hey there,

I'm using a global "idle timer" and for some reason, after the app is started the first time the timer event is launched it will launch dozens of times.

After 1..2 regular events all becomes normal. Any idea or tips?

Using AIR SDK 2.7

Best,

Cedric

This topic has been closed for replies.
Correct answer

Hello,

I wrote this workaround for Timer et setTimeOut:

https://github.com/jonasmonnier/Mobilo/tree/master/src/com/mobilo/time

A Timer :

var id:int = Interval.create(method, delay, repeatCount);

A Timeout :

var id:int = Timeout.create(method, delay, params);

Examples here :

https://github.com/jonasmonnier/Mobilo/tree/master/src/test

They are all based on my Tick class to use an unique ENTER_FRAME

2 replies

Correct answer
June 27, 2011

Hello,

I wrote this workaround for Timer et setTimeOut:

https://github.com/jonasmonnier/Mobilo/tree/master/src/com/mobilo/time

A Timer :

var id:int = Interval.create(method, delay, repeatCount);

A Timeout :

var id:int = Timeout.create(method, delay, params);

Examples here :

https://github.com/jonasmonnier/Mobilo/tree/master/src/test

They are all based on my Tick class to use an unique ENTER_FRAME

Cedmo55Author
Known Participant
June 27, 2011

Hey, just in this second I was already looking at your code thanks to the previous post ;-)

Will try to implement this and thank you for your code.

Best,

Cedric

June 27, 2011

Interessed by feedback

Participating Frequently
June 26, 2011

Hi Cedmo55,

same problems with timer.

The timers initial call is also wrong.

I've been posting in this thread http://forums.adobe.com/thread/865144?tstart=0

There is also a workaround.

You can vote for the bug here https://bugbase.adobe.com/index.cfm?event=bug&id=2904026