views:

2318

answers:

10

Hi,

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

+1  A: 

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?

easement
All excellent questions. I used the dynamic method though will try the static method. firebug does not show the swf file being requested.thanksT
Toby Mills
+2  A: 

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

Armitage
thanks for this. i ended up going with the static code for speed but will implement your suggestion. appreciated.t
Toby Mills
A: 

Oh my goodness. 2-3 hours wasted trying to get swfobject display flash in firefox and I've finally solved it--but not without Armitage's help. The only thing I'd say is that I only ended up having to place the line:

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

in the <Head/> node. The swfobject.embedSWF() line and all the custom code did not need to be located there.

Also--I can't comment at this time (something about a ranking thing)...but I would have if I could. Thanks Armitage! +1

Alex
A: 

This is happening to me too. Only started yesterday. I didn't change anything in my code and it's only in my copy of FireFox 3.5

Could it be a virus. It's driving me nuts.

Dave
A: 

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?

Toby Mills
+1  A: 

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...

Phil
A: 

It's so strange! I catch the same problem using registerObject, it is normal in IE but not in FF3.5, wasted 3 more hours, thanks all you guys just put the in head, it will solved.

cqin
A: 

I had the same problem, but it was a MasterPage issue. Phil gave me the clue. I had the following in my tag:

    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>

    <script type="text/javascript">
    // <![CDATA[

        var flashvars = {};
        var params = {};
        params.wmode = "opaque";
        params.scale = "exactFit";
        var attributes = {};
        swfobject.embedSWF("RainbowWishBackgroundText.swf", "flashTarget", "100%", "870", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

    // ]]>
    </script>

I changed it to:

    <script type="text/javascript">
    // <![CDATA[

        var flashvars = {};
        var params = {};
        params.wmode = "opaque";
        params.scale = "exactFit";
        var attributes = {};
        swfobject.embedSWF("RainbowWishBackgroundText.swf", "flashTarget", "100%", "870", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

    // ]]>
    </script>

    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>

and now it works!

Larry
A: 

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:

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

The swf was created using Flash Builder 4.

georgemck
A: 

Well, I was trying the solution proposed by http://code.google.com/p/swfobject/wiki/faq question 11: "11. How can I avoid that extra whitespace is created underneath my SWF?" which suggests to do the following:

object { display:block; }

But it did not work!!

I tried Armitage's solution: swfobject.switchOffAutoHideShow();

and it worked!!

Thank you so much Armitage! You are an Angel!!

Rafa