如何删除地理位置事件as3

时间:2014-04-16 09:00:00

标签: actionscript-3 flash geolocation actionscript-2

使用gpson_btn我需要删除地理更新......

gpsoff_btn.addEventListener(MouseEvent.CLICK, geoON);
function geoON(event: Event): void {
if (Geolocation.isSupported) {
    var geo = new Geolocation();
    geo.setRequestedUpdateInterval(1);
    geo.addEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);
    gpsoff_btn.visible = false;
}
}

1 个答案:

答案 0 :(得分:0)

我找到了解决方案!

gpson_btn.addEventListener(MouseEvent.CLICK, geoOFF);
function geoOFF(event: Event): void {
geo.removeEventListener(GeolocationEvent.UPDATE, geolocationUpdateHandler);