views:

126

answers:

1

Excuse me if this is an obvious question,

How can you use SWFobject to automatically redirect to another URL - NOT add an a href but physically load another URL ?

I'm using SWFobject 2 at the moment .

-- the SWFobject code ...

swfobject.embedSWF("MYSITE.swf", "myAlternativeContent", "850", "700", "9.0.0", false, flashvars, params, attributes);

--- 2 tricks I've tried in the myAlternativeContent DIV ...

1 ...

    <div id="myAlternativeContent">
          <meta HTTP-EQUIV="REFRESH" content="0; url=http://www.NOFLASHSITE.com"&gt;
    </div>

2 ...

    <div id="myAlternativeContent">
          <script language="javascript" type="text/javascript">
            window.location="http://www.NOFLASHSITE.com";
          </script>
    </div> 

--- both of these load the alternative (http://www.NOFLASHSITE.com) regardless ..

any help is apreciated - MW

+3  A: 

According to the SWFObject API, you could do something like this:

<script type="text/javascript">
swfobject.addLoadEvent(function() {
    if (!swfobject.hasFlashPlayerVersion("9.0.18")) {
        window.location = "http://www.NOFLASHSITE.com";
    }
});
</script>

Make sure that script block is in the <head> of your html file, and replace the "9.0.18" with whatever minimum version of flash you require.

RJ Regenold
**RJ you are the man !!** that worked great! thanks again - MW
MW