This is a function - very similar to a function in VBA or any other language. It first sets a lookat point and then simply looks at that view. You need to review the Google API to understand it better.
The function also sets two event listeners.
Code:window.google.earth.addEventListener(ge.getWindow(), 'mousedown',stopFlight);
This is a window wide (whole webbrowser) event listener, it is listening for the mousedown event and when that happens it calls the "stopFlight" function.
Code:google.earth.addEventListener(ge.getView(), "viewchangeend", pointreached);
similarly this is a google earth wide listener which listens for a special event that GE throws and that is "viewchanged" this event is thrown when the GE reaches the viewpoint. Then it calls the function "pointreached". This is the event listener which is the key to making your flight.
The functions then remove the eventlisteners WHICH IS IMPORTANT and then fires a navigation change. Did you put window.location into google search and read??? This is going to try and navigate to window.location = ('03'); a page named "03" which of course does not exist. You are going to CANCEL the navigation see in the URL what page it is (in this case 03) and know that the next point needs to be given to GE.
Whilst it is all a VBA/Access project I really must say again that the Javascript stuff is not really for this forum and I only learnt enough to be dangerous with GE.
Hi Darbid,
Thanks again.
I did some research (using google search engine) before sending my last post on Windows.Location (it's just that am a newbie in JavaScript programming).
I understand your explanation on navigating to a fake page [windows.location(3)] but i don't know if there is a function i need to refer to in your previous post that explains what you mean by 'case 03'.
I have been trying to decode your last post thats why it has taken me this long to reply.
Am i omitting any function that i should add.
Thanks agn