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 12 of 12

Thread: Flash or jpg

  1. #1
    New to the CF scene
    Join Date
    Aug 2003
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flash or jpg

    Hi guys,

    What I am looking to do is have a flash banner on the top of my page but have it so that if the user doent have the flash plug-in, the banner changes to a static jpg.

    I was wondering if anyone knows what codes or language is used to make this happen. I have posted this question in a few forums and no-one seems to know. Can anyone help me?

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    A 4D universe
    Posts
    1,337
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have to use javascript to detect whether the user has flash or activex enabled. However it is possible to do it with php also.

    Post up which method you would prefer and I'll move the topic to the corresponding forum, so you can get an answer quickly.
    http://www.mudsplat.com - Web design, print, and marketing solutions.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    FL, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I suggest javascript
    CYWebmaster.com - See why we dot com!!
    ACJavascripts.com - Cut & Paste Javascripts!
    SimplyProgram.com - Personal Blog

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Raleigh, NC
    Posts
    484
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here an example...

    Code:
    <html>
    <head>
    <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','introplay.htm','index.htm',true);return document.MM_returnValue">
    Flash Detection
    </body>
    </html>
    Links:
    red has pluggin
    blue doesnt
    Last edited by webmarkart; 08-29-2003 at 08:43 PM.
    -WebMark Art
    Programming is 80% thinking and 20% spelling

  • #5
    New Coder
    Join Date
    Sep 2003
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Javascript is not reliable as a player detection method- what happens if someone has Javascript turned off?

    More people now have the flash player installed than have Javascript turned on.

    The *only* reliable way to detect Flash is to use de facto HTML and actionscript.

    Stage One- Flash detection
    =====================

    Build a very simple one frame swf which contains no artwork, only a frame action. The frame action is this-

    Code:
    getURL("index2.html");
    Export this movie as a Flash5 swf.

    Also put a meta refresh in the head of the page this swf sites in.

    Code:
    <META HTTP-EQUIV="refresh"
    content="5; URL=index3.html">
    This stage then simply detects whether someone has the flash player installed. If they have they go to index2.html instantly. If they haven't they go to index3.html which contains the HTML version of your site via the meta refresh which kicks in after 5 seconds. Assuming they do have the flash player installed, then we go to the next stage (If you wanted to do version detection)-

    Stage Two- Flash Version detection
    ==========================

    Build another simple swf with no art just this code on frame1

    Code:
    version= getVersion();
    space=version.indexOf(" ");
    myString=version.substring(space+1, version.lemgth);
    myArray=myString.split(",");
    player= new Object();
    player.platform=version.substring(0,space);
    player.majorVersion=parseInt(myArray[0]);
    player.minorVersion=parseInt(myArray[1]);
    player.buildNo=parseInt(myArray[2]);
    player.patchNo=parseInt(myArray[3]);
    if (player.majorVersion==6) {
    getURL("flash6index.html");
    }else{
    getURL("flash5index.html");
    }
    export this swf as a flash 5 movie and put it in index2.html
    http://www.dotdragnet.com
    http://www.kevinleitch.co.uk

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ingenious But what happens if you have meta-refresh disabled

    My preferred method is no detection - include the flash <object> with redundent content inside - if a visitor doesn't have the plugin, they see the redundent content, otherwise they see the movie.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #7
    New Coder
    Join Date
    Sep 2003
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by brothercake
    [B]Ingenious But what happens if you have meta-refresh disabled
    Then you're screwed

    OT- BTW are you the same brothercake that posts on accessifyforums?
    http://www.dotdragnet.com
    http://www.kevinleitch.co.uk

  • #8
    Regular Coder
    Join Date
    Jul 2002
    Location
    Raleigh, NC
    Posts
    484
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If any detection at all I use javascript... if they have turned it off than thats their problem. If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?
    -WebMark Art
    Programming is 80% thinking and 20% spelling

  • #9
    New Coder
    Join Date
    Sep 2003
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by webmarkart
    If any detection at all I use javascript... if they have turned it off than thats their problem.
    Personal choice I guess.

    If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?
    No, but I wouldn't expect to have to hack unnecessary crap in to make it work either.
    http://www.dotdragnet.com
    http://www.kevinleitch.co.uk

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Kev@DDN
    OT- BTW are you the same brothercake that posts on accessifyforums?
    Yeah I am you must be kev?
    Last edited by brothercake; 09-06-2003 at 02:11 AM.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #11
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Originally posted by webmarkart
    If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?
    Yes.....if you are deaf
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #12
    New Coder
    Join Date
    Nov 2003
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts
    may have been posted above but im too lazy to read all of it...
    here's what i'd do:

    within the flash file do the detect plugin thing...
    if they have the plugin direct em to a page with the flash banner, if not direct em to a duplicate page only with the jpg banner...

    -katalyst
    i'm always learning


  •  

    Posting Permissions

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