Determining device and platform capabilities

Macromedia Flash Lite 1.1 from Adobe includes a number of ActionScript variables that provide information about features and capabilities available to Flash Lite applications running on a particular device. For example, the _capLoadData variable indicates if the device supports loading external data, and the _capSMS variable indicates if the device supports sending SMS (short message service) messages. For a full list of capability variables, see Capabilities in the Flash Lite 1.x ActionScript Language Reference.

Typically, you use capability variables to determine if a device supports a specific feature before attempting to use that feature. For example, suppose that you wanted to develop an application that downloads data from a web server using the loadVariables() function. Before attempting to load the data, you can first check the value of the _capLoadData variable to determine if the device supports that feature, as follows:

if(_capLoadData == 1) {
    loadVariables("http://foo.com/data.txt");
} else {
    status_message = "Sorry, unable to load external data."
}

Flash Lite defines capability variables on the root timeline of the main SWF file. So to access these variables from another timeline--for example, from within a movie clip's timeline--you need to qualify the path to the variable. For instance, the following example uses a slash (/) to provide the fully qualified path to the _capSMS variable.

canSendSMS = /:_capSMS