How can I use javascript to determine when a Flash movie has ended? ie like an SWF "MovieEnded" event
I would recommend that you add some code into the final frame of the SWF which would trigger the Javascript code in your HTML page. You can use getURL to do this simply, or there are some more robust methods.
The right way would be to modify the flash movie to call a javascript function whenever it has ended. The right way to call the javascript function would be using the ExternalInterface class:
ExternalInterface.call("javascriptFunction");
However, if you don't have access to the inner workings of the flash movie, the simplest way would probably be to just poll the current frame number of the flash movie on some interval and determine whether or not it has ended. An ugly and deprecated way to get the current frame number of the flash movie would be to use the ancient, but working, TellTarget method:
document.getElementById('idOfEmbeddedFlash').TCurrentFrame('/');