Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Geolocation in Flash Lite 4

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Created: manikantan (17 Oct 2010)
Last edited: hamishwillee (14 May 2013)



With the evolution of Symbian ^3 devices in the market, Flash Lite 4 is now supported on Nokia devices. Nokia N8 is the first device from the Nokia family to support it. Flash Lite 4 is a giant leap from the prominent Flash Lite 3 paradigm and offers better performance and offers support for multi-touch, accelerometer and so on. This article concentrates on creating a simple map based application using the Geolocation API in Flash Lite 4. This code or software was built using Adobe Flash CS5 and successfully tested on Adobe Device Central CS5.

This code example is written on Actionscript 3 for Flash Lite 4 devices. In this example, we acquire GPS coordinates from the device sensors and display a Google Map of that location.


1. Adobe Flash Toolit CS5

2. Google Maps API for Flash As3 - available at

3. Google Maps API serial/key.


Inside Flash CS5, create a new Flash Lite 4 document of size 360 X 425 px. Create a textfield (names locTxt) where we will display the input co-ordinates. We shall add the map element via code.

Note.pngNote: For information on using the Google Maps API for Flash in general, this is a good read.

In the first frame on the timeline paste,

import flash.sensors.Geolocation;
var geo:Geolocation = new Geolocation();
geo.addEventListener(GeolocationEvent.UPDATE, showLoc);
var lat:Number;
var long:Number;
var map:Map = new Map();
map.key = "Your-API_KEY-goes-here";
map.sensor = "true";
map.setSize(new Point(stage.stageWidth, stage.stageHeight - 20));
map.x = 15; map.y = 15;
function showLoc(e:GeolocationEvent):void {
trace("loc info came");
locTxt.text = e.latitude.toString() + ", " + e.longitude.toString();
lat = e.latitude; long = e.longitude;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
function onMapReady(event:Event):void {
map.setCenter(new LatLng(lat,long), 14, MapType.NORMAL_MAP_TYPE);


Executing this code inside Flash CS5, opens the desktop run-time Flash player which will show errors of missing Geolocation classes. Hence open the same compiled SWF inside Device Central CS5.

Ss2 geo.jpg


Device Central CS5 offers a wide range of emulation methods for Flash content on phones or devices in general. As seen in the image, there are new options in the Device Central screen. The point of focus to us here is however the ability to get GPS coordinates while testing. The one of the panels in the right (Geolocation) gives the option to send GPS co-ordinates as a signal into the emulation toolkit. Simply enter the latitude and longitude in the appropriate textfields and press SEND TO DEVICE button. This triggers an input GPS signal for the device.

Ss geo.jpg

The image below shows the network traffic monitoring panel that describes the quantity of inbound and outbound traffic.

Ss3 geo.jpg


 07:53, 17 October 2010 (UTC)

For more tutorials from the same author

Flashactions croozeus

This page was last modified on 14 May 2013, at 01:37.
57 page views in the last 30 days.