Is there an image alternative to users that don't have flash

I want users who do not have flash player installed to be able to view the main banner as a .jpg. I tried to publish the file with a jpg and the image doesn’t show in the HTML. I think it might be showing up as blank because my slide show dynamically loads in the files? I’ve also tried a variety of those lovely IE hacks but they are obviously not cross browser friendly. If anybody has any javascript work-arounds or knows what I’m doing wrong please feel free to chime in! See attached files for my example. Thank you!

altHTML is what you’re looking for.


<embed ... altHTML='<img src="image.jpeg" alt="" />' />
<!--OR-->
<param name="altHTML" value='<img src="image.jpeg" alt="" />' />

Note the use of single quotes and double quotes, either in your altHTML use surround with single, and use double the rest of the time, or visa versa. If you don’t, then it’ll think you’re ending the altHTML before you want to.

There is no such thing as altHTML.

Here’s the correct way to attach flash to a web page where the alternate image will display if the flash isn’t supported.

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="300" height="200">
<param name="movie" value="flash.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<!--[if gte IE 7]><!-->
<object data="flash.swf"
width="300" height="200" type="application/x-shockwave-flash">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="wmode" value="transparent">
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
[b]<img src="alternateimage.jpg" alt="text for if neither flash nor image is supported">[/b]
</object>
<!--><![endif]-->
</object>

There is no such thing as altHTML.

It exists. Although I had the syntax missed up. It only applies to an object or applet tag. http://www.yaldex.com/wJSAdtional/altHTMLProperty.htm

It doesn’t exist. That page is wrong.

See http://www.w3.org/TR/REC-html40/struct/objects.html for the standards and you’ll see there is no such attribute.

As you can see from the code I posted above there is no need for such an attribute to exist anyway. Plus it can’t exist since attributes can only ever contain plain text and can never contain HTML.

That page is wrong.

Okay, so don’t use it, but it still works.

Perhaps in one or two browsers but probably not in the thousands of others because it isn’t HTML.

Why use proprietary non-standard garbage when there is a proper way to do it. That would be like strapping a few feathers to your arms and jumping off a cliff and expecting to fly - it works (provided you are a bird) but not if you are an elephant or a person (whereas going in a plane works for all).

I tried both ways but neither of them worked out. Thanks anyways :slight_smile:

Use swfobject to embed the swf. Place the image in the relevant div in the html, if the user has flash and javascript enabled the div gets rewritten to use the swf instead

Thank you so much!!!

1st method!

<object type="application/x-shockwave-flash
data=“yourflashhere.swf”
width=“550” height=“400”>
<param name=“movie”
value=“yourflashhere.swf” />
<img src=“noflash.gif”
width=“200” height=“100” alt=“not availablet” />
</object>

Notice the Image that will appear once Flash plugin is not available.
that’s why they are placed in a single object tag

2nd Method

<object width=“550” height=“400”>
<param name=“movie” value=“flashfile.swf”>
<embed src=“http://fun.tmc.dyn.ee/groovin_granny.swf” width=“550” height=“400”>
</embed>
<noembed>
<img src=“noflash.gif”><br>Not availeble
</noembed>
</object>

<noembed> is better way if you want to include more than image (script, text, table, etc etc etc

End of tutorial :eye:

I think using swfobject is the best option

Why?

[QUOTE=Dinoraptor101;4624386]1st method!

<object type="application/x-shockwave-flash
data=“yourflashhere.swf”
width=“550” height=“400”>
<param name=“movie”
value=“yourflashhere.swf” />
<img src=“noflash.gif”
width=“200” height=“100” alt=“not availablet” />
</object>

Notice the Image that will appear once Flash plugin is not available.
that’s why they are placed in a single object tag

I tried this and if I turn my flash off in my browser, the image appears. However, if the flash is on, my swf does not appear in Fire Fox. In IE I get flashing buttons, but my flash images from the XML file don’t show up. Am I doing something wrong?

Please go through this it will help you better[URL=“http://stephensulzberger.wordpress.com/2008/01/12/incorporating-flash-components-on-web-pages-why-macromedia-is-not-so-good-and-why-swfobject-is-still-the-best/”]

I think this will solve most of ur issue.

It is simple to use too

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <title>SWFObject dynamic embed - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>
    
    <script type="text/javascript">
    swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
    </script>

  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
  </body>
</html>

This is enough

I have flash on my home page too and want to display a jpg image when flash is not present. I have code that does that but it does not validate in the w3 validator. Here is the code:

      <script language="javascript"> 
        var MM_contentVersion = 6;
        var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
        if ( plugin ) {
                        var words = navigator.plugins["Shockwave Flash"].description.split(" ");
                    for (var i = 0; i < words.length; ++i) 
                    {
                        if (isNaN(parseInt(words[i])))
                        continue;
                        var MM_PluginVersion = words[i];
                    }
                var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
        }
        else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
           && (navigator.appVersion.indexOf("Win") != -1)) {
                document.write('<SCR' + 'IPT LANGUAGE=VBScript\\> \
'); //FS hide this from IE4.5 Mac by splitting the tag
                document.write('on error resume next \
');
                document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\
');
                document.write('</SCR' + 'IPT\\> \
');
        }
        if ( MM_FlashCanPlay )
        {
                document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="770" height="200">');
                document.write('<param name="wmode" value="transparent"/>');
                document.write('<param name="movie" value="/flash/myflash.swf" />');
                document.write('<param name="quality" value="high" />');
                document.write('<embed  src="/flash/myflash.swf" wmode="transparent" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="770" height="200"></embed>');
                document.write('</object>');
        }
        else
        {
                document.write('<img src="/Images/banner.jpg" width="770" height="200" alt="No Flash">')
        }
      </script>

Several parts of this do not validate:

  1. the less than “<” in this code: for (var i = 0; i < words.length; ++i)
  2. This tag splitting: document.write(‘<SCR’ + 'IPT LANGUAGE=VBScript\>
    ');
  3. The double &&: var plugin = (navigator.mimeTypes && navigator.mimeTypes[“application/x-shockwave-flash”])

How can I either get this code to validate (and function :wink: ) or replace it with something better? What is good or different about this code from what is suggested by felgall or Dijup

Would I be better off going with one of the other bits of code in this thread? I am not a programmer so I need guidance. Thanks.

BTW I use:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

[URL=“http://code.google.com/p/swfobject/wiki/documentation"][SIZE="5”]Use swfobject
use swfobject
use swfobject
use swfobject[/SIZE]

Thanks EastCoast. I used it and it seems to be working. Any idea of the age/era of the code I have? It seems like so much crap compared to swfobject code.

Any idea of the age/era of the code I have?

var MM_contentVersion = 6; That’s dream beaver and sounds pretty old

else if (navigator.userAgent && navigator.userAgent.indexOf(“MSIE”)>=0

this is old-fashioned browser sniffing.
//FS hide this from IE4.5 Mac by splitting the tag

it’s old enough to be worrying about IE4. That’s pretty bad.

I used swfobject once, but I prefer <object><alt content/></object> myself. swfobject means, if you have JS off, you won’t see flash regardless of whether or not you have the flashplayer.
But beyond that, it’s nice because it’s cross-browser.

That was the feeling I had too when I discovered it. :eek: This was sold to me as something modern in the last 6 months…