I'm creating a quiz and as a timer in the quiz I have a flash movie (an animated clock). I poll the clock every second to see if the time for the quiz has run out.
The code for this functionality looks like this: (simplified)
$(window).load(function() {
var flashMovie = getFlashMovieObject(flashId);
var timeElapsed = flashMovie.GetVariable("timeElapsed");
var timeSet = flashMovie.GetVariable("countdown");
var degrees = flashMovie.GetVariable("degrees");
var timerStatus = flashMovie.GetVariable("timerStatus");
});
First of all, it just fetches the flash movie object, and then calls some mehtods on the object. This works fine in Firefox (pc & mac), Safari (mac) but in IE8 on pc it returns 'unexpected error on line 3' (or any other line that uses the flashMovie object).
The code for the getFlashMovieObject() function looks like this:
function getFlashMovieObject(movieName)
{
if (navigator.appName.indexOf ("Microsoft") !=-1) {
return window[movieName];
}
return document[movieName];
}
Any help is appreciated!
Thanks in advance.
UPDATE: I have figured out that if set IE8 clear the cache for each reload, then this occurs. If I don't, then it only fails the first time, and all subsequent reloads work fine. I don't understand how the cache can resolve this issue.