SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist mafunk's Avatar
    Join Date
    Apr 2003
    Location
    portland
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help Fixing Back Button on Flash Detected Page

    My site www.divadesignworld.com has a flash detector such that if the visitor has flash it forwards to the flash site. If the visitor doesn't have flash it forwards to the html site. The problem is that the way it is coded the backbutton doesn't work on the flash site, which get's my flash site banned from google. Can someone help me fix this.

    code from indes page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="refresh" content="3;url=html_index.html" />
    <title>diva-design-world</title>
    </head>
    <body>
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="80" height="80">
    <param name="movie" value="flash_detection.swf?flashContentURL=diva-design-world.html&altContentURL=html_index.html&contentVersion=7&contentMajorRevision=0&contentMinorRevision=0&allowFlashAutoInstall=false" />
    <param name="quality" value="low" />
    <embed src="flash_detection.swf?flashContentURL=diva-design-world.html&altContentURL=html_index.html&contentVersion=7&contentMajorRevision=0&contentMinorRevision=0&allowFlashAutoInstall=false" quality="low" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="80" height="80" />
    </object>
    </body>
    </html>



    code from html page that holds the flash
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Diva Design World</title>
    <style type="text/css">
    <!--
    .style1 {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    }
    a:link {
    color: #990000;
    text-decoration: none;
    }
    a:visited {
    text-decoration: none;
    }
    a:hover {
    text-decoration: underline;
    color: #CC0000;
    }
    a:active {
    text-decoration: none;
    }
    -->
    </style>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    subscribeURL="http://divadesignworld.com/news/?p=subscribe&id=3"

    function getDigest(){
    reWin=window.open(subscribeURL,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=860,height=540,top=100,left=100')
    }

    mapURL="http://maps.google.com/maps?q=9999%20SW%20Wilshire%20Portland%20OR&spn=0.023071%2C0.039312"

    function openMap(){
    reWin=window.open(mapURL,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=820,height=540,top=100,left=100')
    }

    function openWindow( strUrl, strFeatures ){
    if( strFeatures == null ){
    strFeatures = "width=600,height=600"; // add any other features you need. i.e. toolbars, scrollbars, etc.
    }
    window.open( strUrl, '', strFeatures );
    }

    contactForm="contact.html"

    function openForm(){
    reWin=window.open(contactForm,'hell','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=430,height=560,top=100,left=100')
    }

    function bookmarksite(title, url){
    if (document.all)
    window.external.AddFavorite(url, title);
    else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
    }

    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }

    //-->
    </script>
    </head>
    <body bgcolor="#ffffff" onload="MM_preloadImages('view-html-button-over.gif')">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    LOADING SOUND
    0%
    -->
    <p class="style1">&nbsp;</p>
    <table width="100%" height="100%" border="0" align="center">
    <tr>
    <td rowspan="2">&nbsp;</td>
    <td align="left" valign="top"><span class="style1"><a href="http://www.divadesignworld.com/html_index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('View HTML Button','','view-html-button-over.gif',1)"><img src="view-html-button.gif" alt="View HTML Version" name="View HTML Button" width="110" height="31" border="0" id="View HTML Button" /></a></span></td>
    <td rowspan="2">&nbsp;</td>
    </tr>
    <tr>
    <td align="center" valign="top"><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="710" height="525" id="diva-design-world_v1" align="top">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="diva-design-world.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <param name="SCALE" value="exactfit" />
    <embed src="diva-design-world.swf" width="710" height="525" align="top" quality="high" bgcolor="#ffffff" name="diva-design-world_v1" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="exactfit" /></embed>
    </object></td>
    </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </body>
    </html>
    MaFunk

  2. #2
    SitePoint Evangelist mafunk's Avatar
    Join Date
    Apr 2003
    Location
    portland
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?
    MaFunk

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    India
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    
    if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]  && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin && navigator.plugins && navigator.plugins["Shockwave Flash"]){
     //Flash 3 or later is available
    document.location.href="someflashpage.html";
    
    } else {
     //Flash 3 or later not available
    document.location.href="somehtmlpage.html";
    
    }
    //-->
    </SCRIPT>
    Use this script on your first page to detect if flash is installed or not. I think you dont have problems with ur back button now.

    I got it from Macromedia site. Dont blame me if it doesnt work..

    If it works pls do post to confirm others...
    Afru.

  4. #4
    SitePoint Evangelist mafunk's Avatar
    Join Date
    Apr 2003
    Location
    portland
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Afru.
    Thanks for the tip. I plugged it in as written below, but what happened was that the page then went straigt to the html index page rather than the flash page AND I DO have flash installed on the monitors that I checked the site on. Got any ideas?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="refresh" content="3;url=html_index.html" />
    <title>diva-design-world</title>
    </head>
    <body>
    <SCRIPT LANGUAGE="JavaScript">
    <!--

    if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin && navigator.plugins && navigator.plugins["Shockwave Flash"]){
    //Flash 3 or later is available
    document.location.href="http://www.divadesignworld.com/diva-design-world.html";

    } else {
    //Flash 3 or later not available
    document.location.href="http://www.divadesignworld.com/html_index.html";

    }
    //-->
    </SCRIPT>
    </body>
    </html>
    MaFunk

  5. #5
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    India
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Hi,

    Sorry that the code is not working properly. Actually I grabbed it from macromedia and so not tested it before posting. The hell with macromedia guys. Its not working even on my IE. Ok anyhow here is another version I got from somewhere. It not only detects flash but also lots of other plugins.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>diva-design-world</title>
    </head>
    <body>
    <SCRIPT LANGUAGE="JavaScript" src="plugins.js"></script>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    //SAMPLE USAGE- detect "Flash"
    if (pluginlist.indexOf("Flash")!=-1) // Flash Installed...
    document.location.href="http://www.divadesignworld.com/diva-design-world.html";
    else // Flash Not Intalled...
    document.location.href="http://www.divadesignworld.com/html_index.html";
    
    //-->
    </SCRIPT>
    </body>
    </html>
    And here is plugins.js below. Save it as plugins.js into the same directory.


    Code:
    //This script detects the following:
    //Flash
    //Windows Media Player
    //Java
    //Shockwave
    //RealPlayer
    //QuickTime
    //Acrobat Reader
    //SVG Viewer
    
    
    var agt=navigator.userAgent.toLowerCase();
    var ie  = (agt.indexOf("msie") != -1);
    var ns  = (navigator.appName.indexOf("Netscape") != -1);
    var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
    var mac = (agt.indexOf("mac")!=-1);
    
    if (ie && win) {	pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","Acrobat Reader"); }
    if (ns || !win) {
    		nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
    		pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","Acrobat Reader");
    }
    
    function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); if (result) return name+','; else return ''; }
    function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }
    
    pluginlist += navigator.javaEnabled() ? "Java," : "";
    if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
    
    //SAMPLE USAGE- detect "Flash"
    //if (pluginlist.indexOf("Flash")!=-1)
    //document.write("You have flash installed")
    I have tested this script for flash on Win IE and Firefox and it is working fine.
    Hope this helps you out... Please do post your results...

    Have a nice day

    Afru.

  6. #6
    SitePoint Evangelist mafunk's Avatar
    Join Date
    Apr 2003
    Location
    portland
    Posts
    441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YOU ROCK!!! Thanks so much. It works. Hey, I want to show small appreciation. Do you have paypal? I'll send you $15. Not much, but a token of appreciation.
    MaFunk


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
  •