IE6 Fix For Hidden SWF

Since IE6′s browser penetration is still somewhere in the 60th percentile I thought it would be worthwhile to mention a gotcha in IE6 when embedding SWF. If the CSS of node in the DOM that your SWF file is displayed in is set to visibility=’hidden’, either prior to loading or dynamically at run-time the code execution in the SWF is halted. One workaround for this is to use a different CSS property ‘textIndent‘. You can set your node CSS property of ‘textIndent: -9999px;‘ which effectively moves the node completely off screen. Then if you need to show the node again, reset the textIndent property to ‘textIndent: 0px;‘. This worked great in my application, but keep in mind that the box model rules in IE will cause the node to continue to occupy that screen real estate. If you want to force the width and height to size the node as well, then just modify those properties (width, height) and toggle them up/down as appropriate.

About John Pencola

Hello, my name is John Pencola. I can't get enough of exploring new technologies, discussing software principals, creating programs and having fun with interface design. I will share my experiences here and hope Liquid Language adds some useful information to the vast sea that is the web.
This entry was posted in ActionScript 2, ActionScript 3, Browsers. Bookmark the permalink.