Alright, I'll try to explain this. If you want to use the longitude and latitude values from your Geolocation event when you click your mouse on something, you need to store those values somewhere because MouseEvent does not have those properties. Only GeolocationEvent has those.
How do you solve this then? simple, create variables that hold the latitude and longitude values that are retrieved in your geolocationUpdateHandler(...) method.
Sorta like this
var latitude:Number = 0;
var longitude:Number = 0;
function onMapReady(e: Event): void {
if (Geolocation.isSupported) {
var geo = new Geolocation();
geo.setRequestedUpdateInterval(100);
geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);
}
}
function geolocationUpdateHandler(event: GeolocationEvent): void {
trace("lat:" + event.latitude.toString() + " - ");
trace("long:" + event.longitude.toString() + "° - ");
latitude = event.latitude;
longitude = event.longitude;
}
ve_btn.addEventListener(MouseEvent.CLICK, send);
function send(e: MouseEvent): void {
navigateToURL(new URLRequest("mailto:test@test.lv?body=</br> latitude=" + latitude.toString() + "</br> longitude=" + longitude.toString()));
}