How can I use javascript to determine when a Flash movie has ended? ie like an SWF “MovieEnded” event
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
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: