The Device object is a Nokia-proprietary ActionScript
2.0 extension that allows Flash Lite applications to access device features
and to retrieve and modify system properties. The Device object
gives you more control over how your Flash Lite application behaves on a device.
Note: Before you can create Flash Lite applications that use the Device object,
you must install the corresponding ActionScript 2.0 class files for your Flash
IDE. For further instructions, see section Installing the
ActionScript class files at the end of this page.
The Device object is supported since Flash
Lite Player 3.1 on S60 5th Edition and selected S60 3rd Edition, Feature
Pack 2 devices. While you can publish your application for Flash Lite 2.0
or newer, the Device object only works on S60 devices that
support Flash Lite 3.1.
The following table lists the methods provided by the Device object.
To create a Device object, use the new method.
Before using the method, you need to import the com.nokia.lib.Device class.
The following code snippet creates a new Device object:
import com.nokia.lib.Device; var deviceObject:Object = new Device();
Creating a new Device object requires no arguments.
The new method returns a Device object
for a successful call. You can use the object to call the various Device object
methods (see above).
The following code snippet creates a new Device object
and uses it to call the ExpediteConnection method:
import com.nokia.lib.Device; var deviceObject:Object = new Device(); deviceObject.ExpediteConnection();
Before you can create Flash Lite applications that use the Device object,
you must install the corresponding ActionScript 2.0 class files for your Flash
IDE:
Download the S60 ActionScript API library package (ZIP) to your computer by clicking the following link:
Extract the package to the class path folder of your Flash IDE. For example, if you are using Adobe Flash CS4 on Microsoft Windows XP, extract the package to:
%USERPROFILE%\Local Settings\Application Data\Adobe\Flash
CS4\en\Configuration\Classes\
Make sure that the extracted ActionScript class files (.as)
are located in:
<classpath>\com\nokia\lib\
You can now create Flash Lite applications that use the Device object.