automatically Close flash player after playing
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开发者_StackOverflow社区 orginal content. tried everything.
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");
精彩评论