Capture Flash Player Event in Javascript
I need to capture the event raised when a flash video ends. If possible, I'd like to distinguish this from a user clicking the stop button.
One thing to be made perfectly clear:
I DON'T HAVE CONTROL OVER THE PRESENTATIONS OR THE SWF FILES.
What I'm looking for is simple (I thought) js automation of the client player object, not more complex interactivit开发者_运维百科y with the presentation itself. I thought this would be really simple stuff, but a dozen Google and Bing searches later, I can't find anything about it.
TIA.
No can do. The SWF doesn't make anything available to the JavaScript layer unless it's specifically programmed to do so. Without access to the source, you're out of luck.
The only way I know to do this is via an ExternalInterface call from the swf.
If you DID have access to the fla, then the following would work
// Flash
import flash.external.ExternalInterface;
ExternalInterace.call('yourJavascriptFunction', 'other', 'paramaters', 'to', 'pass');
// Javascript
function yourJavascriptFunction(param1, param2, param3, param4) {
doSomethingWith(param1, param2, param3, param4);
}
精彩评论