Forum Moderators: open

Message Too Old, No Replies

HTML Flash Detection

flash_detection.swf is doing all sorts of weird things to me

         

shimeal

5:58 pm on Feb 8, 2005 (gmt 0)

10+ Year Member



Hi,

I am using the following code ( I chopped it down to save some space):

<param name="movie" value="flash_detection.swf?flashContentURL=bdclogo.swf&altContentURL=bdclogo.jpg">
<embed src="flash_detection.swf?flashContentURL=bdclogo.swf&altContentURL=bdclogo.jpg" loop="false" quality="high" bgcolor="#ffffff" width="310" height="80" name="bdclogo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>

The problem I am having is with flash_detection.swf. When I use it, it creates a new window for my bdc.logo.swf instead of simply displaying the file inside of the html page I have the object embedded in. I am simply using the stock flash_detection.swf file available from MM under the HTML Flash Detection method.

How do I modify this file to keep a new window from opening (BTW when this new window opens, the .swf file fills the window whereas it is supposed to only be 300x80 pixels) or the above code to keep it from opening in a new window and messing up my page? Thanks!

whoisgregg

1:52 am on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This part of the code should point to an HTML file, not the flash file directly:

flash_detection.swf?flashContentURL=bdclogo.swf&altContentURL=bdclogo.jpg

In both the param and the embed, this error occurs and needs to be corrected.

You need to point to an HTML file that has the object tag that defines the width and height of the flash movie, otherwise any SWF file directly linked will fill the browser screen (or sometimes download and be opened in Flash Player).

[edited for accidentally leaving bit of paragraph I had deleted]

shimeal

3:45 am on Feb 16, 2005 (gmt 0)

10+ Year Member



Thanks for your help!

shimeal

4:37 am on Feb 16, 2005 (gmt 0)

10+ Year Member



OK, I have tried this but I think I made my request unclear. I do not want the flash to open another file. When I follow your directions, everything works as you said but the bdclogo.html opens and creates a new window. How do I run the flash detection and have the swf inside of bdclogo.html open in the same document that the reference to the flash detection file is located in?

whoisgregg

10:00 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The flash detection method used depends on a flash file working which sends the user to the correct page. You can't have it load up in the same page because the detection uses a <meta> redirect tag to handle the failure scenario sending the user to a "download flash" page.

You can do flash detection on the same page as the flash movie, but you'll need to find a different way than using the built in method. :(

There are some javascript snippets out there that do a decent job. Plus, you could skip detection and rely on the browser to suggest it on it's own while providing a static gif alternative in the <object> code.

jetboy

11:05 am on Feb 16, 2005 (gmt 0)

10+ Year Member



As whoisgregg suggests, you could always leave out the detect section. I've been using a variation of Hixie's standards compliant Flash embed with good results:

<!--[if!IE]><-->
<object type="application/x-shockwave-flash" data="/pathto/flash.swf">
<param name="quality" value="high" />
<img src="/images/backup.jpg" alt="" />
</object>
<!--><![endif]-->

<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param name="movie" value="/pathto/flash.swf" />
<param name="quality" value="high" />
<img src="/images/backup.jpg" alt="" />
</object>
<![endif]-->

The only problem browser seems to be IE5.2 under OSX, which doesn't display anything. IE5.0 under OS9 works fine!

Edit: With the dimensions of the <object> element set in CSS.

Edit: Should be a space between the 'if' and the exclamation mark. WebmasterWorld editor seems to think otherwise!