Recently Nokia released an update to the Flash Lite 3 player on their 5800 XpressMusic device (S60 5th Edition), upgrading it to 3.1 via their “App Update” mechanism. While there’s been a few bugs found with the new 3.1 update that gets installed, it did signal a departure from the firmware upgrade path for updating on-device software, and certainly makes it a lot easier for device owners to stay up to date.
Nokia have also just added to their ActionScript API (S60 Platform Services) a new Device object , for use only with the FL3.1 runtime on S60 5th Ed (and selected S60 3rd Ed FP2) devices. This is in addition to the Service object, which opens access to APIs such as Location, Contacts and Messaging through native ActionScript 2.0 classes.
The new Device object has two methods, one of which solves a problem that myself and may other Flash developers have had hassles with on Nokia S60 5th Ed touch devices – auto rotation. The methods are
- DisableAutoRotation - Disables automatic screen rotation on the device (woo!)
- ExpediteConnection - Starts the network connection setup process for the Flash Lite application
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:
S60_ActionScript_API_library_1_0.zip
- 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\
Once that’s done, here’s how to use the new Device object:
import com.nokia.lib.Device;
var deviceObject:Object = new Device();
deviceObject.DisableAutoRotation(true);
deviceObject.ExpediteConnection();
Pretty simple huh!? You can get all the info, plus other very useful documentation on the Service object (for access Contacts, Messaging, Location, etc), in Forum Nokia Flash Lite Developer’s Library (1.4) now.