...

View Full Version : Flash object and IE7 window close error



loamguy1
01-29-2009, 05:42 AM
Hi, I have an <OBJECT> tag in my html page that successfully loads and plays an .flv file, both in IE7 and Firefox.

However, the interesting thing is that if I close the IE7 tab for this page, the tab doesn't close. Instead, the tab starts blinking, then when I click on it, I get an IE messagebox with the vague error message "Object required."

I'm asked if I want to continue running scripts on this page. I click NO and the same error message immediately appears. And again. And again. At first I thought, I'd be in an infinite loop, but after 7 NOs, finally I was allowed to close the window.

Here's my <OBJECT> tag. I don't have the classid parm, and when I tried to insert it for debugging purposes, the .flv file wouldn't load.



<object>
<param name="wmode" value="opaque" />
<embed
src="file.swf"
width="480"
height="300"
bgcolor="#ffffff"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=http://hoster.com/thevid.flv&image=preview.jpg"
wmode="opaque"
/>
</object>

I don't get an error on Firefox, so I can't debug it. I've tried other OBJECT parameters on the net and can't find anything that seems to address this problem.

Any ideas?

gnomeontherun
01-29-2009, 09:51 AM
First try to embed your file using SWFObject, there is a tutorial in my signature for information. If that doesn't help, then there is likely an issue with your SWF file, and we would need to see it and the code.

loamguy1
01-29-2009, 02:14 PM
Ok, thanks, I'll give that a try.

Do you see any reason why SWFObject wouldn't work with an .flv file instead of .swf?

gnomeontherun
01-29-2009, 04:23 PM
You can't view an FLV without a SWF. FLV is the video file, just like an AVI or MOV are video files. All of them require some kind of player, in this case FLV (Flash Video) is designed to be played by a SWF.

loamguy1
01-29-2009, 07:01 PM
Thanks a lot, the SWFObject is working great after some tinkering with the parameters. It got rid of my issue where the tab was blinking and wouldn't close.

FYI, here's what I started with.:

<object>
<param name="wmode" value="opaque" />
<embed
src="player.swf"
width="480"
height="300"
bgcolor="#ffffff"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="file=http://hoster.com/thevid.flv&image=preview.jpg"
wmode="opaque"
/>
</object>

This worked in all browsers except for IE7 which caused the aforementioned problem.


Here's the new working code that fixed the initial problem:


<div id="flashcontent">
&nbsp;
</div>
<script type="text/javascript">
var so = new SWFObject("player.swf", "mymovie", "480", "300", "8", "#ffffff");
so.addParam("quality", "high");
so.addParam("wmode", "transparent");
so.addParam("salign", "t");
so.addVariable("file", "http://hoster.com/thevid.flv");
so.addVariable("image", "preview.jpg");
so.write("flashcontent");
</script>

Interesting that in some examples I saw, the first SWFObject parameter is the user-specific .swf file, not the common "player.swf" file. I wonder since my flash file is hosted elsewhere and is an .flv if this is why the parms need to be set up this way?

In any case, it works! Thanks, jeremy.

gnomeontherun
01-29-2009, 09:08 PM
You're welcome!

I'm not sure what you mean by 'user specific .swf file', but they can be called anything. You can load a SWF file from any site, but a swf file can only load content from either the current site or from a site that has a proper crossdomain.xml file.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum