How to make this into a button click? AS3 Help

Right now this code starts when it grabs GPS info but i need to to only grab when someone clicks a BUTTON… But i cannot get it into a button.

Can someone please help!

import flash.sensors.Geolocation;
import flash.events.GeolocationEvent;
import com.google.maps.LatLng;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
 
 
 
 
 

var geo:Geolocation = new Geolocation();
geo.addEventListener(GeolocationEvent.UPDATE, showLoc);
geo.setRequestedUpdateInterval(100);
var lat:Number;
var long:Number;
var map:Map = new Map();
map.key = "AIzaSyBgRP4JCKvbhjt_RdpLVt_kmDidXhx7Stg";
map.sensor = "true";
map.setSize(new Point(stage.stageWidth, stage.stageHeight - 20));
map.x = 15; map.y = 15;


function showLoc(e:GeolocationEvent):void {
    trace("loc info came");
    locTxt.text = e.latitude.toString() + ", " + e.longitude.toString();
    lat = e.latitude; long = e.longitude;
 
    map.addEventListener(MapEvent.MAP_READY, onMapReady);
    this.addChild(map);
}

function onMapReady(event:Event):void {
 
   map.setCenter(new LatLng(lat,long), 14, MapType.NORMAL_MAP_TYPE);
}