2014-04-16 46 views
0

隨着gpson_btn我需要刪除地理更新...如何刪除地理位置事件AS3

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; 
} 
} 

回答

0

我找到了解決方案!

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