A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: IE Blocking Flash Content

  1. #1
    ScreenResolution
    Join Date
    Mar 2001
    Location
    Anglesey, N Wales
    Posts
    107

    IE Blocking Flash Content

    Hi All,

    There may already be some help on the forums for this, but I thought I'd add my version of the solution here as I found it quite easy.

    The problem:
    The latest "security patch" for Windows/IE now disables the <embed> and <object> tags, forcing users to "Click to Activate" the Flash content.

    The solution:
    Create a file called "foo.js". Add the following code to it:
    Code:
    function RunFoo()
    {
        document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="245" height="400" id="navigation" align="middle">');
        document.write('<param name="movie" value="navigation.swf" />');
        document.write('</object>');
    }
    Obviously replace the entire "<object classid="clsid:d27cdb6e......>" with the object tag that you would normally use. Just happens that my movie wants these width and height values etc.

    Next, change the "navigation.swf" bit to what ever your movie is called.

    Save the file.

    Now you need to add some code to your HTML page that the flash movie is going into.

    Add the following line into the <HEAD> section of your HTML:
    Code:
    <script src="foo.js" type="text/javascript"></script>
    Now replace all the <object> stuff you had originally, in my case this:
    Code:
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="245" height="400" id="navigationcontact" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="navigation.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <embed src="navigationcontact.swf" quality="high" bgcolor="#ffffff" width="245" height="400" name="navigation" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    With this:
    Code:
    <script type="text/javascript">RunFoo();</script>
    And that's it! Just upload the .js file and your new HTML file and you should be good.

    All the best,

    O.

  2. #2
    2008 Man of the Year JWin's Avatar
    Join Date
    Aug 2005
    Location
    here
    Posts
    768
    I don't understand the rationale behind this. If you just have document.write(s) for the lines of code, all you gotta do is insert the script into the body. No need for having something in the head AND in the body.

    SAMedia Blog (general bs) :: jwinmedia (my music site)
    "Think of an advertisement where the product you're marketing is Jesus!"
    -From a work for hire ad

  3. #3
    ScreenResolution
    Join Date
    Mar 2001
    Location
    Anglesey, N Wales
    Posts
    107
    I'm not a programmer, so I don't understand the rationale behind any of it. All I know is that it works...

  4. #4
    Senior Member
    Join Date
    Oct 2001
    Posts
    219
    Owen, thank you for your contribution. When you say you are not a programmer, yet it works, you bring up one of the main goals a programmer tries to acheive. They not only want to solve the problem, but they want to solve it in the most efficient way possible. So when people question your methods, they are merely asking if this is the most simple and efficient way to do the job.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center