I am curently assembling some Macromedia Captivate Flash movie on one web page for my students.
When my user clicks on one of my links, a javascript function makes my DIV content visible simulating a modal window. After, when my user clicks on my X icon I then hide the DIV (visibility:hidden).
All works well but my embedded Flash continues playing! (well I hear the sound cause the DIV is now hidden...)
How can I flush-unload-stop the player elegantly from a javascript function? I must not run into memory issues cause my students can peek at many videos within a session.
I did this exact thing about a year ago and for the life of me I can't remember off the top of my head. I will look around and try and remember what site it was for then try and find the files. If you haven't got a response by then I will post. I may not get back till tomorrow, but I will.
I just remebered...You have to put your closing "X" in the flash. Then you can stop the movie/sounds whatever and call your javascript function to hide the div.
With Macromedia Captivate all is automatic. It assembles the HTML embedding the SWF file.
Actually I am displaying this HTML file through an Iframe within a DIV for wich I change the VISIBILITY attribute.
I am producing a lot of short movies and don't want to go into the SWF (yes I have a decompiler!). So in this context I really need to control the movie from the browser's JAVASCRIPT.
If I understand you correctly, your HTML is Div -> IFrame -> Flash
A hack could be to change the location of the iframe to a blank page while the div is hidden. This may not be acceptable for you as the flash movie will be restarted every time the div is unhidden.
When my user clicks on a link, it bumps the current movie by a new one. So I simply built a web page embedding a one frame movie with the Stop_All_Sound(); built in actionscript function!
Here is some code:
function loadContent(URL, idName, my_width, my_height) {
var objetDom = document.getElementById(idName);
loadContent("http://abc.abc.com/stopAllSounds.html","my_DIV",500,500);
document.getElementById(idName).style.visibility = "hidden";
}
=================
Salut et à la prochaine!