Hi, I have a script that displays a list of song names and when the user clicks a 'listen' button the filename is passed to a Flash player which loads and plays the mp3. This works fine for Safari and IE but not in Mozilla. Does anyone know of any issues around Mozilla and using Javascript to pass variables to flash and call functions in flash.
In my header file I have -
<script type="text/javascript">
var flash;
window.onload = function() {
if(navigator.appName.indexOf("Microsoft") != -1) {
flash = window.flashObject;
}else {
flash = window.document.flashObject;
}
}
AND
function PassFlash($preview_mp3){
if(navigator.appName.indexOf("Microsoft") != -1) {
window.flashObject.SetVariable("fileToPlay", $preview_mp3);
window.flashObject.updatePlayer();
}
else {
window.document.flashObject.SetVariable("fileToPlay", $preview_mp3);
window.document.flashObject.updatePlayer();
}
Then I embed the swf like so ...
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="flashObject" width="191" height="29" align="middle" id="flashObject">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="preview.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="preview.swf" quality="high" bgcolor="#ffffff" width="191" height="29" name="flashObject" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
The swf is successfully loaded in all browsers (main ones) but in Firefox does not appear to receive the variables or function calls that javascript passes.
Many thanks in advance for any hints or tales of your own experience with this.
Stephen