Forum Moderators: open

Message Too Old, No Replies

Flash detect and PNG Transparency

conflicting javascripts

         

john_m

10:22 pm on Sep 6, 2005 (gmt 0)

10+ Year Member



Hi,
I have a PNG transparency script and a flash detect script. The Flash script is in conflict with the PNG transparency JS file, as the PNG transparency works only when the Flash script is removed. The Flash script consists of a JS file and some script in the HTML:

<script type="text/javascript">
<!--
if (flash.ver[6]) { var oeTags = '<object type="application/x-shockwave-flash" data="swf/intro.swf" width="700" height="375">'
+ '<param name="movie" value="swf/intro.swf" />'
+ '<param name="menu" value="false" />'
+ '</object>';
document.write(oeTags); }
else if (flash.installed) { var oldFlash = '<img src="images/oldflash.gif" alt="Old version of Flash plug-in installed. Please update by clicking here" />';
document.write(oldFlash); }
else { var noFlash = '<img src="images/noflash.gif" alt="Flash plug-in not installed. To view the intro sequence, you will need to install it by clicking here" />';
document.write(noFlash.htm); }
//-->
</script>

Is there something wrong with the syntax? I have tried a different PNG transparency script and it still doesn't work.

Thanks!

Bernard Marx

11:47 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> if (flash.ver[6])

Is this how you reference a Flash object?
Does the variable, flash, hold a reference to anything?

> document.write(noFlash.htm);

You can't write a file using doc.write.
This will cause an error anyway, since there is no defined variable, noFlash, (and thus it can't have a property, htm).

john_m

12:21 am on Sep 7, 2005 (gmt 0)

10+ Year Member



Thanks for pointing the .htm error out! It still doesn't change the page display.
> if (flash.ver[6]) is the way the script references the Flash version. The lowest required version is 6, if it's an old version, the script goes to (flash.installed) and if there is no plug-in, it goes to else.

john_m

12:23 am on Sep 7, 2005 (gmt 0)

10+ Year Member



Actually, I think that did resolve it- the error was actually an incorrect reference to a SWF. Dunno why it affected the PNG script, but it works now. Thanks a lot!