Skip to main content
Known Participant
Jun 26, 2011 7:43 PM UTC
Answered

iOS Timer Problem - Best practice?

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 is closed to new replies. Start a new post to keep the conversation going.
Correct answer
Jun 27, 2011 10:07 AM UTC

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

7 replies

Correct answer
Jun 27, 2011 10:07 AM UTC

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

Translate
Cedmo55Author
Known Participant
Jun 27, 2011 10:09 AM UTC

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

Translate
Jun 27, 2011 11:26 AM UTC

Interessed by feedback

Translate
Participating Frequently
Jun 26, 2011 8:43 PM UTC

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

Translate