A Timeout class to replace setTimeout in AIR 2.7 for IOS

After a first compilation of my AIR for IOS app with AIR 2.7 the situation was not good.
The application that was developed and optimized for AIR 2.6 was not smooth at all 🙁

A few tests later, I isolated the problem: The setTimout() method does not work properly (?) in AIR 2.7 for IOS.

I solved the problem by coding a small static class to manage multiple timeout using an unique enterFrame event.

Thx to Seraf for bug fix and clear(id) method 🙂

Use :

Timeout.create(myMethod, 300, "optional param");

Below are screenshots of the setTimeout() VS my Timeout.execute() test on my iPhone 3GS.

AIR 2.6 VS AIR 2.7

Below the test for FP 10.1.
Note that my class performs better or equal to the setTimeout() method (Win7 – FF4 – FP 11).

Test class source
Timeout class source

4 thoughts on “A Timeout class to replace setTimeout in AIR 2.7 for IOS

  1. Timer and setTimeout are slower than a good old EnterFrame with AIR mobile !
    Very simple and usefull class.
    Did you try the same test on Android ? Curious to know the result…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.