There are more than a few things that could be wrong with your script, but without an example actually on the web to look at, I'm only able to provide some tips.
1. You are running swfobject embed and swffit right after one another. Not knowing how swffit works, you'll want to be careful as swfobject doesn't guarantee that there will actually be a flash movie in that div by the time that statement executes. If swffit.js is smart enough to deal with that, all well and good, but you might have some timing issues, particularly with people and a slow internet connection. 2. Your question referred to trying to get wmode: transparent to work. At the end of the day, wmode is just a parameter that can be passed into your Flash movie, and SWFObject 2.x has a very specific way of passing parameters to the SWFObject itself. As always, refer to http://code.google.com/p/swfobject/wiki/generator where you can either use Bobby's online version of the code generator or download it yourself for personal use. The point here is that the code generator will generate the code you need. The first part deals with some basics, which file to include when referring to swfobject, which publishing method to use (click the "What is this?" link for information about the difference between static and dynamic publishing), which Flash version to detect for and embed Flash content instead of showing alternative content, and the path for the expressInstall.swf file if that's the way you want people to upgrade their Flash installation. The second part of the code generator, labeled SWF Definition is what should interest you. By clicking the "more" link, you'll be able to see how you can add attributes and parameters and how that affects code. In fact, there's a very specific dropdown for wmode that you can use that should get you to where you want to go. A basic variant using static publishing looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> swfobject.registerObject("myFlashContent", "9.0.0"); </script> </head> <body> <div> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="myFlashContent"> <param name="movie" value="untitled.swf" /> <param name="wmode" value="transparent" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="untitled.swf" width="800" height="600"> <param name="wmode" value="transparent" /> <!--<![endif]--> <a href="http://www.adobe.com/go/getflashplayer"> <img src=" http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div> </body> </html> while the version using dynamic publishing looks like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; var params = {}; params.wmode = "transparent"; var attributes = {}; swfobject.embedSWF("untitled.swf", "myAlternativeContent", "800", "600", "9.0.0", false, flashvars, params, attributes); </script> </head> <body> <div id="myAlternativeContent"> <a href="http://www.adobe.com/go/getflashplayer"> <img src=" http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> </div> </body> </html> Hope this helps. Vincent Polite On Mon, Aug 10, 2009 at 8:15 AM, funkyasswhiteboy <[email protected]>wrote: > > Guys, can anyone, please, help me with wmode:transparent. I tried > following examples I found here, but something breaks along the way. > What is a proper way to include it? Here's my code, thank you: > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html style="overflow: auto; height: 100%;" xml:lang="en" > xmlns="http://www.w3.org/1999/xhtml" lang="en"><head> > > > <meta http-equiv="Content-Type" content="text/html; > charset=ISO-8859-1"> > <title></title> > <script type="text/javascript" src="swfobject.js"></script> > <script type="text/javascript" > src="swffit.js"></script><style > media="screen" type="text/css">object {position:absolute}#my_flash > {visibility:hidden}#my_flash {width:100%; height:100%}</style> > <script type="text/javascript"> > swfobject.embedSWF("example.swf", "my_flash", "650", > "750", > "8.0.0"); > swffit.fit("my_flash",1,1,650,750,true,false); > </script> > <style type="text/css"> > body{ > background-color: #B1BEC6; > background-image: url(bg02.gif); > background-repeat: repeat-x; > } > </style> > </head><body style="margin: 0pt; padding: 0pt; height: 100%;"> > <object style="visibility: visible; width: 650px; left: 50%; margin- > left: -385px; height: 520px; top: auto; margin-top: 0pt;" > id="my_flash" data="example.swf" type="application/x-shockwave-flash" > width="650" height="750"></object> > </body></html> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---
