RSS

Geolocation AS3 API for iPhone

10 Aug

I thought I’d share a spot of code with you, a new API in the flash.sensors package called Geolocation. The package itself is enabled for iPhone applications (created with Flash Pro Cs5), FL4 and AIR in the future enabling you to create context-aware applications with ease.

The coolest thing is that you can test your applications that feature Geolocation in Device Central Cs5, very cool.
//——————————————–
import flash.sensors.Geolocation;
import flash.events.GeolocationEvent;

var locale:Geolocation = new Geolocation();
locale.setRequestedUpdateInterval(5000);
locale.addEventListener(GeolocationEvent.UPDATE, onlocationHandler);

function onlocationHandler(e:GeolocationEvent):void{

lastLat = e.latitude;
lastLon = e.longitude;
gpsIcon_mc.visible = !gpsIcon_mc.visible;

}

//—————————

Original Link

Advertisements
 
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: