Note that there are some explanatory texts on larger screens.

plurals
  1. POMozilla Firefox problem with Javascript and Flash communication
    text
    copied!<p>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.</p> <p>In my header file I have - </p> <pre><code>&lt;script type="text/javascript"&gt; var flash; window.onload = function() { if(navigator.appName.indexOf("Microsoft") != -1) { flash = window.flashObject; }else { flash = window.document.flashObject; } } </code></pre> <p>AND</p> <pre><code>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(); } </code></pre> <p>Then I embed the swf like so ... </p> <pre><code>&lt;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"&gt; &lt;param name="allowScriptAccess" value="sameDomain" /&gt; &lt;param name="movie" value="preview.swf" /&gt; &lt;param name="quality" value="high" /&gt; &lt;param name="bgcolor" value="#ffffff" /&gt; &lt;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" /&gt; &lt;/object&gt; </code></pre> <p>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. </p> <p>Many thanks in advance for any hints or tales of your own experience with this.</p> <p>Stephen</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload