Calendar

March 2007
M T W T F S S
« Feb   Apr »
 1234
567891011
12131415161718
19202122232425
262728293031  

Tag Cloud

Categories

Archives

Highest Rated

Most Viewed

Recent Posts

Recent Comments


« IndyFlex PhotoBrowser Code | Main | Tutorials - Apollo (Community) »

Apollo Online/Offline sample - full source included

By Rich Tretola | March 21, 2007Print This Post Print This Post
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
970 views

Here is a nice little example of testing for online and offline within Apollo. It is very basic.

Test it by either hitting the Test Connection button or by pulling your cable on disconnecting your wireless.

Here is what is occurring within the application:

Thats it. There are additional URLLoader events that can be checked but I haven’t included them in this example. Check the documentation for details on these events. Here is the results:

ONLINE:

online.jpg

OFFLINE:

offline.jpg

Download the application

Download source code

Share/Save/Bookmark

Topics: Adobe AIR, Tutorials |

7 Responses to “Apollo Online/Offline sample - full source included”

  1. Critter Says:
    April 8th, 2007 at 9:27 pm

    Thanks for this. I have basically put this code into it’s own class and am calling it like:

    var tmpStatus:NetworkStatus = new NetworkStatus(url_tocheck);
    trace(tmpStatus.getStatus());

    tmpStatus.getStatus() keeps returning a false. It’s as if it is being executed too quickly. is there a way to make sure the initializing of the class fully executes before proceeding to the next line of code?

    Crit

  2. Rob Says:
    April 11th, 2007 at 11:23 am

    Very handy, I knew it would be simple to do but it’s nice to know I don’t have to figure it out myself when I come to need it! Thanks mate

    Rob

  3. dave Says:
    July 22nd, 2007 at 3:28 pm

    Ran into problem with this example. Attempted a complete removal of Apollo and a re-install of AIR. Still ran into a compatibility error.

  4. everythingflex Says:
    July 22nd, 2007 at 3:52 pm

    Yes, this is old code that was built for Apollo, it will not run under AIR.

  5. john Says:
    April 29th, 2008 at 4:24 pm

    After a LOT of effort for a c# programmer, a little update

  6. john Says:
    April 29th, 2008 at 4:37 pm

    OOPS CAN’T POST THE CODE !

    basically import flash.desktop.Native Application;
    in the init function replace the shell call with
    Native Application.native Application .add Even tListener(Event.NETWORK_CHANGE,o nNetworkChange);

    all else should wok fine

  7. everythingflex Says:
    April 29th, 2008 at 7:20 pm

    Sorry you wasted so much time with an old Apollo sample. Check out my ConnectionManager class in the EverythingFlexAIR swc:
    http://blog.everythingflex.com/air-central/everythingflexair1swc/

Comments