automatically Close flash player after playing

794 views Asked by At

I need to close a flash player which is overlayed over another portion. When the video is over, the 'div' i created (overlayed to display video)must vanish showing the orginal content. tried everything.

1

There are 1 answers

0
KARASZI István On BEST ANSWER

You can use a javascript function to remove the opened <div> from the DOM tree.

For this use the Externalinterface.call method. You just need to create a javascript function and embed the flash object with the allowscriptaccess option set to always.

The JavaScript function could be like this:

function removeDiv( divID ) {
    var div = document.getElementById(divID);
    div.parentNode.removeChild(div);
}

And the corresponding ActionScript:

ExternalInterface.call("removeDiv", "theIdOfTheDiv");