Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8: Working with Data > DETECTING CHANGES IN NETWORK AVAILABILITY

DETECTING CHANGES IN NETWORK AVAILABILITY

It's important to have a backup when working with online data services. It's also useful for the user to know what the status is when a network service changes.

Retrieving Data with URLRequest

You request remote data via an HTTP URL path through using the URLRequest and URLLoader classes. Both classes are found in the flash.net package and need to be imported in ActionScript mobile projects, as shown in the following snippet:

import flash.net.URLRequest;
import flash.net.URLLoader;

Because they are part of the same package, they can also be imported using the star notation, indicating that all classes within that package should be imported into the document:

import flash.net.*;

The following snippet shows a request for remote data, using two variables — a URLRequest object called urlRequest, and a URLLoader object called urlLoader:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint