Strange Firefox SWFObject display issue

11,107

Solution 1

I've had a similar issue for the past day and a half, and I've found the answer. The swfobject.embedSWF should be in the HEAD portion of the document (I'm guessing that is not possible for Joomla). If you can't move it there, there is a workaround here. You can add this line of code:

swfobject.switchOffAutoHideShow();

just before your swfobject.embedSWF

Solution 2

Had the same problem, but one of the answers here helped. Might help someone else.

The registerObject needs to be in the head tag.

My code was putting it there, however... I was writing a debug message to the page before the opening html tag. If you looked at the page source (right click for example), the registerObject was in the head tag.

However, because I was writing a debug message before the registerobject, Firefox was closing the head tag and moving the registerObject to the body. Found this by looking at Firebug which showed different html code layout.

Removed the debug message and it worked. Another hour wasted...

Solution 3

I encountered this using a swf file with WordPress.

The swf file only had a problem within FF 3.5 where it did not load.

I added:

<script src="swfobject.js" type="text/javascript"></script>

to the theme's header.php and it fixed the issue for me, too.

The swf was created using Flash Builder 4.

Solution 4

Did you try the dynamic method? http://code.google.com/p/swfobject/wiki/documentation

Also, what is firebug's NET panel telling you? does it show the request for the file? If so what is the server response?

Share:
11,107
Toby Mills
Author by

Toby Mills

Web Consultant with over 10 years experience developing online applications using .Net, VB, C#, JS, HTML etc...

Updated on November 19, 2022

Comments

  • Toby Mills
    Toby Mills over 1 year

    I am having the strangest issue with a site i am developing. On the homepage i have a flash slide show which displays fine in IE. However it does not appear in Firefox but instead leaves a white space.

    I am using SWFObject to display the flash. I knows its at least firing as the holding image is removed. However if i right click on the white area i get an HTML context menu not a flash menu which suggests its not even writing the flash object to the page let alone loading the flash SWF file.

    If i save the source of the homepage to a static HTML and upload that to the server it works fine.

    Could this be anything to do with the file encoding or http headers?

    I've tried so many things like removing content, JS, CSS etc. The fact that a static version of the file works but the server driven ones does not is driving me mad.

    The server is running Joomla CMS.

    The code is:

    <script type="text/javascript" src="/scripts/swfobject.js"></script>
    <script type="text/javascript">swfobject.embedSWF("/flash/loader.swf", "flashContent", "960", "310", "9.0.0", "/flash/expressInstall.swf");</script>
    

    HTML Code:

    <div class="middle" id="flashContent">
    <img class="panelBgImage" src="/images/main/Home.jpg" title="Home"/>
    </div>
    

    A temporary version of the site can be seen @ http://slc.synterax.com/ (Available until 06/08/2009)

    Thanks in advance


    having the script in the head portion of the page certainly fixed it for me. However i have seen problems in the past with flash and firefox and swf. the only way i got around it was to reinstall flash :(

    i take it works fine in the other browsers?

    • Lior Cohen
      Lior Cohen over 14 years
      How about some code? Can you show us exactly what you're doing?
  • Toby Mills
    Toby Mills over 14 years
    All excellent questions. I used the dynamic method though will try the static method. firebug does not show the swf file being requested. thanks T
  • Toby Mills
    Toby Mills over 14 years
    thanks for this. i ended up going with the static code for speed but will implement your suggestion. appreciated. t
  • Ricardo Gomes
    Ricardo Gomes about 11 years
    i know this is an old answer, so FWIW if you try this now, you get a not a function error...