Skip to content Skip to sidebar Skip to footer

Setvariable Is Not Working In Firefox

I have implemented a web page with Flash Player. And then I have used SetVariable keyword to give a param for a flash player object. document.getElementById('flashPlayer').SetVari

Solution 1:

Firefox can only use this function on the embed element, not the object element.

HTML

<object id="flashPlayer">
    <embed id="flashPlayerEmbed">
</object>

Javascript

var player = document.getElementById('flashPlayer');

if(typeof(player.SetVariable) == 'undefined') {
   player = document.getElementById('flashPlayerEmbed');
}

player.SetVariable("plyaer.jsUrl", "www.my.com/Songs/a.mp3");

Solution 2:

I suspect that this is caused when trying to call the SetVariable call before the swf is loaded. Try something like this:

functionsomeTest() {
 ....
 document.getElementById('flashPlayer').SetVariable("player.jsUrl","www.my.com/Songs/a.mp3");
}

And onload on body

<bodyonload="setTimeout('someTest();',500);">

Hope it helps

Post a Comment for "Setvariable Is Not Working In Firefox"