Location > Blog

Firefox 3 and Flash SWF outline problem using SWFObject 2.1

For some time now I have been using SWFObject to load flash objects on my web pages, it works great to avoid the ‘click to activate’ problems that affect IE6, IE7 and Opera 9+.  In IE the browser displays an outline around the flash object and a tooltip ‘Click to activate’  

Firefox 3 and Flash SWF outline problem using SWFObject 2.1I recently upgraded to the SWFObject 2.1, I was using the SWFObject 1.5 and I ran into a problem where the flash is outlined with a faint dotted border. The previous SWFObject code worked great no outline, also it only appeared in Firefox 3. I took a closer look and found the new version used an OBJECT tag instead of an EMBED tag in the generated HTML. The demo code provided with SWFObject did not have this outline either. By removing parameters I isolated the problem to the wmode=transparent  setting. Removing it the outline disappeared but of course the flash was no longer transparent.

So with a bit of digging round the solution presented itself, you need to set the object style outline: none. Editing the sites style sheet is an option but I think this behaviour should be corrected in SWFObject as one of the reasons for using it is to avoid the border in the first place. Maybe they will fix it. Another way to fix this if you use a component based approach is to use SWFObject to fix the problem.

<script type="text/javascript"
        swfobject.embedSWF("test.swf""myContent""300""120""9.0.0""expressInstall.swf"); 
        swfobject.createCSS("#myContent","outline:none"); 
</script> 

 

Sunday August 3 2008 10:10 a.m.

Feedback

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Thursday August 28 2008 1:14 a.m. Serge
Thank's very much for this "outline:none"!!! That border was really annoying!

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Thursday September 4 2008 3:08 a.m. Casi
Thank you for posting this . . . you just saved me a lot of time and frustration.

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Thursday September 4 2008 1:45 p.m. Casi
I'll have to retract my last comment . . . doesn't seem to solve the issue for me in FF 3. I've set outline:none and border:none in my stylesheet and js. :(

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Thursday September 4 2008 2:25 p.m. Matt
Casi the stylesheet method works fine too but if you look on this page http://www.junasoftware.com/servercontrols/swfobject.net.aspx there is a live example of this method working. The createCSS function requires '#myContent' rather than the id of the of the flash element. If you don't put the # in it doesn't work.

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Wednesday October 1 2008 12:05 a.m. fitao
Thank you, it works fine on firefox3.0.3 ...

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Friday October 10 2008 10:01 a.m. Scott B
This is FAQ #15: http://code.google.com/p/swfobject/wiki/faq#15._Why_do_I_see_a_dotted_border_around_my_SWF_when_using_Firefo According to the authors of SWFObject, it's a bug in Firefox.

re: Firefox 3 and Flash SWF outline problem using SWFObject 2.1
Wednesday October 29 2008 8:11 a.m. Dick
You can just add this to your CSS: object { outline: none; }