Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Nov 2007
    Posts
    108
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Flash object and IE7 window close error

    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.

    Code:
    <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?

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • Users who have thanked gnomeontherun for this post:

    loamguy1 (01-29-2009)

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Posts
    108
    Thanks
    14
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #5
    Regular Coder
    Join Date
    Nov 2007
    Posts
    108
    Thanks
    14
    Thanked 0 Times in 0 Posts
    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.:
    Code:
    <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:

    Code:
    <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.

  • #6
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •