-
I am trying to create a quiz for an educational site I'm working on. The quiz itself is in flash and uses FS commands to report the score to the HTML page. Unfortunately, every time I try it, it causes my browser to crash. I'm still learning javascript, so that could be the problem.
The name of the movie is "testmovie" and here is the code I am using:
function testmovie_DoFSCommand(command, args)
{
if ( command == "score" )
document.write(+ args);
}
I'm also using some VBscript:
<!--
// Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub testmovie_FSCommand(ByVal command, ByVal args)
call testmovie_DoFSCommand(command, args)
end sub
//-->
Any ideas? I'd appreciate any help anyone could give. And I apologize if this is a stupid question. :eek:
Thanks, Jaime :D
-
If you are trying to send FSCommands to your Flash movie before it loads, it will crash your browser...
Try setting a javascript variable on your html page like:
flashLoaded = 0;
Then in your Flash movie do an FSCommand("SetFlashLoaded")
In your FSCommand section on your html page
if (command = "SetFlashLoaded")
flashLoaded = 1;
Then you html page will know when it can send commands to your flash page...
-
Thanks so much. You are a life saver... :D