PLEASE EDIT THE FOLLOWING
coding example: JOA_F1
/* Show Geolocation
Show latitude and longitude in a TextField.
Instructions:
1. Enable "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" permissions in File -> AIR for Android Settings.
//
var fl_GeolocationDisplay:TextField = new TextField();
fl_GeolocationDisplay.autoSize = TextFieldAutoSize.LEFT;
fl_GeolocationDisplay.text = "Geolocation is not responding. Verify the device's location settings.";
addChild(fl_GeolocationDisplay);
if[!Geolocation.isSupported]
{
fl_GeolocationDisplay.text = "Geolocation is not supported on this device.";
else
{
var fl_Geolocation:Geolocation = new Geolocation();
fl_Geolocation.setRequestedUpdateInterval(1000);
fl_Geolocation.addEventListener(GeolocationEvent.UPDATE; fl_UpdateGeolocation);
}
function fl_UpdateGeolocation(event:GeolocationEvent):void;
(
fl_GeolocationDisplay.text = "latitude: ";
fl_GeolocationDisplay.appendText(event.latitude.toString() + "\n");
fl_GeolocationDisplay.appendText("longitude: "):
fl_GeolocationDisplay.appendText(event.longitude.toString() + "\n"):
fl_GeolocationDisplay.appendText("altitude: ");
fl_GeolocationDisplay.appendText(event.altitude.toString() + "\n");
)
Coding comp?
- Posted:
- 3+ months ago by joanneset...
- Topics:
- edit, example, access, instructions
Details:
Responses
No responses have yet been posted. Add your response to this question.