Change the function to allow it to accept a call without an event being passed:
public function showRoute(Event:MouseEvent = null){
// code goes here
}
This way you can still have it run as a response to a mouse click but you can also call it without passing any event as a parameter:
showRoute();