SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2000
    Location
    CT
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone know javascript that I could put in that would redirect someone that did NOT have flash to an HTML page? Possibly like a <noscript> tag?

    Thanks

    -Steve Klebanow
    http://www.sparkgames.com

  2. #2
    SitePoint Wizard
    Join Date
    Sep 1999
    Posts
    1,390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure how you would set this up, but I know for a fact that this will work:

    Set up the spash page to use flash to send the user to another page. You could have a transparent animation or something that is unreadable to do this. If the user is sent to the page with the animation, then they must have flash. If they aren't sent, then Flash isn't working on their computer.

    I don't know how you'd code it, but that should work if you can do that.

  3. #3
    I'm baaaaaaaaaaaaack! Fluffykins's Avatar
    Join Date
    Aug 2000
    Location
    Manchester, UK
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, it can be done quite easily. I usually use Dreamweaver's built in Detect Plugin behavior. But if you look around some javascript archives online then you'll be able to find something suitable. (sorry I can't think of any off-hand).

    If you've got Dreamweaver then use the behaviour, it needs applying to the body tag of the page. I'd copy and paste you the script Dreamweaver uses to do it but it's sort of copyrighted to Macromedia and they might be upset .

    Does anyone have a non-DW script that does the same thing?
    v-technologies - Freelance Goodness.

  4. #4
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Saw a good solution to this recently. As stated b4, create a flash movie (invisible or otherwise) that redirects to your "flash" page. On the same page, have a refresh tag in your head which redirects automatically to a "non-flash" page. As long as your refresh time is such that it allows your movie to play and redirect, if flash is not enabled in the users browser, they will automatically scoot off to the non-flash page.

    Simple huh?

    I'll see if I can dig out details.

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  5. #5
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a script that I have used in the past to accomplish what you are talking about.
    <script language="JavaScript">
    <!--
    function MM_checkPlugin(plugin, theURL, altURL, IEGoesToURL) { //v2.0
    if ((navigator.plugins && navigator.plugins[plugin]) || //if NS, or
    (IEGoesToURL && //if flag set, and MSIE browser for Win95/NT (ActiveX)
    navigator.appName.indexOf('Microsoft') != -1 &&
    navigator.appVersion.indexOf('Mac') == -1 &&
    navigator.appVersion.indexOf('3.1') == -1)) {
    if (theURL.length>2) window.location = theURL;
    } else {
    if (altURL.length>2) window.location = altURL;
    }
    document.MM_returnValue = false;
    }
    //-->
    </script>
    </head>
    <body bgcolor="#FFFFFF" onLoad="MM_checkPlugin('Shockwave Flash','adobedoor.swf','/home.html',true);return document.MM_returnValue" >


    This is set as the page you want the detection and the redirection to occurr. In this instance, if you have the Flash Plugin you will see the file adobedoor.swf and if you don't, you will go to /home.html. You can borrow the above to see if it works for you simply replace adobedorr.swf and /home.html with the names of your files.


    Hope that helps
    Good Luck!

    after posting this, I wondered how dreamweaver 3 detected this and this is what it put out as the code:


    <script language="JavaScript">
    <!--
    function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v3.0
    var ok=false; document.MM_returnValue = false;
    with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
    else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
    if (!ok) theURL=altURL; if (theURL) window.location=theURL;
    }
    //-->
    </script>
    </head>

    <body bgcolor="#FFFFFF" onLoad="MM_checkPlugin('Shockwave Flash','flashfile.swf','/alternate file goes here',false);return document.MM_returnValue">
    </body>
    <script name="Used by MM_checkPlugin" language="javascript">
    <!--
    with (navigator) if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) document.write(''+
    '<scr'+'ipt language="VBScript">\nOn error resume next\n'+
    'MM_dir = (IsObject(CreateObject("SWCtl.SWCtl.1")) Or IsObject(CreateObject("Macromedia.ActiveShockwave.1")))\n'+
    'MM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
    //-->
    </script>



    You can try that one too.


Bookmarks

Posting Permissions

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