dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: No Plugin display gif image code - How To

  1. #1
    Registered User
    Join Date
    Apr 2000
    Posts
    39

    No Plugin display gif image code - How To

    I am trying to get Flash MX to generate the code under Publish to generate the flash and if the plugin is not detected to just show a gif image. I cannot seem to generate just that. I Don't want the user to download the plugin which is the code it keeps giving me.

    Anyone point me on how to get it?


  2. #2

  3. #3
    Registered User
    Join Date
    Apr 2000
    Posts
    39

    Not Quite what I mean't

    Estudio's thanks for the reply...this is not quite what I meant.

    Here is an example of code that I use. Basically if flash is not detected an image will be shown. I have to actually write out the code becuase I cannot figure out how to get MX to do it via publish.

    I need to figure out how to get Flash to write the Javascript that will embedd the flash and if no plugin is detected instead will display and img file.

    <SCRIPT LANGUAGE=JavaScript>
    <!--
    var UseFlash = 0;
    if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
    // Check for Flash version 5 or greater in Netscape
    var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
    if (plugin && parseInt(plugin.description.substring(plugin.descr iption.indexOf(".")-1))>=5)
    UseFlash = 1;
    } else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
    navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
    // Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
    UseFlash = 1;
    }

    // Mac to override
    var isMac = navigator.userAgent.indexOf("Mac") != -1
    if (isMac) {
    UseFlash = 0;
    } else {
    UseFlash = 1;
    }

    // Allow the cookie to override
    if (document.cookie && (document.cookie.indexOf("FlashRenderOption=P") >= 0)) {
    UseFlash = 1;
    } else if (document.cookie && (document.cookie.indexOf("FlashRenderOption=I") >= 0)) {
    UseFlash = 0;
    }
    if ( UseFlash ) {
    // Use Flash player
    document.write('<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"');
    document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
    document.write(' ID=main2 WIDTH=505 HEIGHT=134>');
    document.write('<PARAM NAME=movie VALUE="main2.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#CCCCCC> ');
    document.write('<EMBED src="main2.swf" quality=high bgcolor=#CCCCCC ');
    document.write(' swLiveConnect=FALSE WIDTH=505 HEIGHT=134');
    document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write('</EMBED>');
    document.write('</OBJECT>');
    } else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)) {
    // Netscape 2 will display the IMG tag below so don't write an extra one
    document.write('<IMG SRC="images/home/mainpic2.jpg" WIDTH=505 HEIGHT=134 usemap="#main" BORDER=0>');
    }
    //-->
    </SCRIPT>

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