-
Javascript to unload or stop Flash?
Hi all,
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.
Thanks for reading!
Live a 100 years, study a 100 years!
-
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.
Any Javascript API for Flash out there?
Live a 100 years, study a 100 years!
-
No!
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.
-
Found a work around!
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);
document.getElementById("main").style.visibility = "visible";
objetDom.src = URL;
objetDom.width=my_width;
objetDom.height=my_height;
}
function close(idName) {
loadContent("http://abc.abc.com/stopAllSounds.html","my_DIV",500,500);
document.getElementById(idName).style.visibility = "hidden";
}
=================
Salut et ร* la prochaine!
Live a 100 years, study a 100 years!
-
Can I have the script sample..
I have been searching around the web and finally I found the right one.... Please can you share the script with me....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|