How do I...?

Detect if Internet Access is Available

If your application utilizes the Internet in any way within your application, you can check to ensure that the user has internet access before continuing, and if they do not, prompt the user to connect.

To accomplish this in AutoPlay Media Studio:

  1. Enter the following script into an event in your application:

connected = HTTP.TestConnection("http://www.indigorose.com", 20, 80, nil, nil);

if connected then
    --Insert your internet related action here
else
    Dialog.Message("Internet Error", "You are not connected to the Internet. This application will now exit");
    Application.Exit();
end

This script checks if the user is connected to the Internet. If after 20 seconds the program cannot find a valid internet connection, it notifies the user, and exits.