I'm using swfObject to embed a flash player in my app. Sporadically, I see errors in FireFox (only, not in IE or Chrome) when trying to communicate with the embedded flash object. The error says "SetVariable is not a function". The code which causes this error executed fine just moments ago, and now shows this error. If I re-load the page and re-run, odds are decent that this doesn't happen again.
I've seen reports on the web about FF not working well with SetVariable, but nothing to fix it. Apparently swfObject should hide all of this but it doesn't.
Here's what my code looks like:
...
var flashvars=...
var params=...
var attributes = {};
attributes.id = "my_player";
if( swfobject.hasFlashPlayerVersion("9.0.0") )
{
swfobject.embedSWF("my_player_js.swf", "my_player_holder", "1", "1", "9.0.0", "", flashvars, params, attributes );
}
....
document.getElementById("my_player").SetVariable( "method:stop", "");
That last line, on FF, sometimes causes the "SetVariable is not a function" error.
Any suggestions on where to look?