广东话发送消息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