SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2000
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How I make it so a plain old GIF or JPG image will display if a visitor does not have Flash installed?

    I have a .swf file I'd like to put on a page, but I'd like to make it so that if a visitor does not have Flash just a plain image will display in its spot.

    Any help would be appreciated.

    Thanks in advance.

    Sean
    Scarsdale Technologies, Inc.
    http://www.scarsdaletech.com

  2. #2
    Misfit
    Join Date
    Apr 2000
    Location
    Pennsylvania, USA
    Posts
    2,266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The answer is JavaScript. I don't know what the exact code would be, but I'm sure you can find something at http://www.javascriptcity.com or http://www.javascript.com.

  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)
    You can do it from within Flash itself when you publish the movie. In the publish settings dialogue box first select either GIF or JPEG as one of the export options. Then, in the HTML style tab within publish settings select "Flash x with image" from the drop down box labelled Template.

    Flash, when you publish the movie, will generate you some HTML / Javascript code and an image file. The code will render the flash movie correctly regardless of browser, and also display the image if the plugin is not available.

    In case anyone's interested, the code looks like this:

    Code:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
     codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
     ID=Movie1 WIDTH=550 HEIGHT=400>
     <PARAM NAME=movie VALUE="Movie1.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <SCRIPT LANGUAGE=JavaScript>
    <!--
    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
    if ( plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4 ) {
    	// Check for Flash version 4 or greater in Netscape
    	document.write('<EMBED src="Movie1.swf" quality=high bgcolor=#FFFFFF ');
    	document.write(' swLiveConnect=FALSE WIDTH=550 HEIGHT=400');
    	document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    } 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="Movie1.gif" WIDTH=550 HEIGHT=400 BORDER=0>');
    }
    //-->
    </SCRIPT>
    <NOEMBED><IMG SRC="Movie1.gif" WIDTH=550 HEIGHT=400 usemap="#Movie1" BORDER=0></NOEMBED>
    <NOSCRIPT><IMG SRC="Movie1.gif" WIDTH=550 HEIGHT=400 usemap="#Movie1" BORDER=0></NOSCRIPT>
    </OBJECT>
    You can replace the generated image with one of your choosing later on should you want to.

    Ady
    v-technologies - Freelance Goodness.


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
  •