廣東話發送消息trought當按下按鈕廣東話發送消息trought當按下按鈕
當它被GPS座標發送每一次電子郵件,但按鈕不起作用單擊
類型錯誤:錯誤#1034:類型強制失敗:無法將flash.events::[email protected]轉換爲flash.events.GeolocationEvent。
ve_btn.addEventListener(MouseEvent.CLICK, fl_UpdateGeolocation_2);
var fl_GeolocationDisplay_2:TextField = new TextField();
fl_GeolocationDisplay_2.autoSize = TextFieldAutoSize.LEFT;
fl_GeolocationDisplay_2.text = "Geolocation is not responding. Verify the device's location settings.";
addChild(fl_GeolocationDisplay_2);
if(!Geolocation.isSupported)
{
fl_GeolocationDisplay_2.text = "Geolocation is not supported on this device.";
}
else
{
var fl_Geolocation_2:Geolocation = new Geolocation();
fl_Geolocation_2.setRequestedUpdateInterval(1000);
fl_Geolocation_2.addEventListener(GeolocationEvent.UPDATE, fl_UpdateGeolocation_2);
}
function fl_UpdateGeolocation_2(event:GeolocationEvent):void
{
fl_GeolocationDisplay_2.text = "latitude: ";
fl_GeolocationDisplay_2.appendText(event.latitude.toString() + "\n");
fl_GeolocationDisplay_2.appendText("longitude: ");
fl_GeolocationDisplay_2.appendText(event.longitude.toString() + "\n");
fl_GeolocationDisplay_2.appendText("altitude: ");
fl_GeolocationDisplay_2.appendText(event.altitude.toString() + "\n");
navigateToURL(new URLRequest("mailto:[email protected]?body=</br> latitude=" + event.latitude.toString() + "</br> longitude=" + event.longitude.toString()));
}
參數事件:的MouseEvent在VE(...)方法沒有一個叫GeolocationEvent屬性或方法,這樣你就可以不寫「event.GeolocationEvent()」,因爲它不存在。 – DodgerThud
我現在做了一些修改 ve_btn.addEventListener(MouseEvent.CLICK,fl_UpdateGeolocation_2); – user3332885
但問題是當它得到的座標它自動發送郵件,但我只需要它在鼠標點擊 – user3332885