This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > March 2004 > Alternative image for non-Flash visitors





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Alternative image for non-Flash visitors
Screenweasel

2004-03-18, 9:29 am

Hello and good morning.

In a web-based environment, is it possible to implement a default image in
place of a Flash movie for those visitors to the site who do not have Flash? If
so, how would I go about accomplishing that?

Thanks!

-screen

jmack007

2004-03-18, 11:29 am

Hello--

You use Javascript to accomplish this. In your page you will place a flash
player and version detection script that will then check to see if the
appropriate version of the flash player is installed on the user's system and
will build the HTML necessary to create OBJECT and EMBED tags.

If the proper player is NOT found, you simply use an ELSE statement in your
Javascript to build and display the HTML that will show your alternative jpeg,
gif, png etc.

If you need a decent script for doing this I can email one to you if you post
an address. Otherwise-- Javascript is the way to go. Just be aware-- you
should also include within you script tags a VBScript as well that will make
sure the movie OR the image will display in your Macintosh IE 5.5 user's
environment (if this is a platform you need to support).

--jmac

Screenweasel

2004-03-18, 11:29 am

Thank you very much for the reply.

I'd appreciate greatly any script you could send me. I'm not well versed in
javascript, just so you know, but have access to resources that are. Here is an
address you can reach me at.

deggleston@benelogic.com

Thanks again!

-screen

Ed Massey

2004-03-19, 1:34 pm

Or you could post it to the forum so everyone can benefit..
Very annoying to search a forum to find that the solution was found but
never posted :)
Thanks

Ed

"jmack007" <webforumsuser@macromedia.com> wrote in message
news:c3cdct$dt$1@forums.macromedia.com...
> Hello--
>
> You use Javascript to accomplish this. In your page you will place a

flash
> player and version detection script that will then check to see if the
> appropriate version of the flash player is installed on the user's system

and
> will build the HTML necessary to create OBJECT and EMBED tags.
>
> If the proper player is NOT found, you simply use an ELSE statement in

your
> Javascript to build and display the HTML that will show your alternative

jpeg,
> gif, png etc.
>
> If you need a decent script for doing this I can email one to you if you

post
> an address. Otherwise-- Javascript is the way to go. Just be aware-- you
> should also include within you script tags a VBScript as well that will

make
> sure the movie OR the image will display in your Macintosh IE 5.5 user's
> environment (if this is a platform you need to support).
>
> --jmac
>



EBMesserLexington

2004-03-20, 8:28 am

You made the generous offer of a javascript and maby a vbscript that would
check for flash player and maby version. I have wrote my own javascript flash
detector, but have found it sketchy in some environments. As for a VBscript I
am completly remiss. My e-mail: is ebmesser@yahoo.com.
I would also be intrested in a way to check their connection speed.

Tanx

EBMesserLexington

2004-03-20, 8:28 am

I have written my own javascript for flash/ version detection but find it
sketchy across environments. As you brought to my attention, I have no vbscript
to support Steve Jobs "fruits". You made a gracious offer to email these
scripts to the instigator of this thread. Would the same be offered to another
humble soul? ebmesser@yahoo.com

jmack007

2004-03-20, 10:28 am

True. True.

So here it is then. You can use this either within the <head> tags of your
HTML document and have javascript build 2 alternate HTML pages (one with the
swf present the other with images present) or, if your page is more involved
then a simple html section and a flash movie you may put the script tags and
the code within the <body> of your document and then just alter the HTML
formatting within the Javascript to display the <object> and or <img> tags
within your page inline.

The VBScript is a very reliable way to include and alter content to be
delivered to your Macintosh users that have the IE 5.5 installed. It is
basically doing the same thing as what the Javascript checker function array
does to determine if flash is present and, if so, what version is present. I
do not know why IE5.5 for Mac chokes on Javascript checking-- I have just found
it does.

Here is the code:

<!--------- Detect for Flash 6+ OR give inline image if not found. ---------->


<script language="javascript" type="text/javascript">

<!--
// Variables to store player version and player presence or not.
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;


// See if the Flash Player is installed and activated for windows platforms.
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;
}



// VBScript for Macintosh display in IE 5.5


// Macintosh platform IE tag fix for detection script.
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&
(navigator.appVersion.indexOf("Win") != -1)) {

//FS hide this from IE4.5 Mac by splitting the tag
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = (
IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." &
MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}


// End VBScript for Macintosh display in IE 5.5



// If Flash 6+ is detected-- build the page and show the SWF.
if ( MM_FlashCanPlay ) {
document.write('<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve
rsion=6,0,0,0" ');
document.write(' id="script" width="778" height="430" align="center">');
document.write(' <param name=movie value="comingsoon.swf"> <param
name=quality value=high> <param name=bgcolor value=#eeeeee> ');
document.write(' <embed src="comingsoon.swf" quality=high bgcolor=#eeeeee
');
document.write(' swLiveConnect=flase width="778" height="430"
name="script" align="center"');
document.write(' type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer">');
document.write(' </embed>');
document.write(' </object>');
}


// If Flash6+ is not present-- build the page and show the jpeg image.
else{
document.write('<img src="comingsoon.jpg" width="778" height="430"
usemap="#script" border=0>');
}


-->


</script>


You can modify the code to sniff for any version of the Flash Player and you
can also change any and all of the HTML form outputted by Javascript to reflect
the contents of your HTML page and generate 2 version dynamically.

--jmac

Ed Massey

2004-03-20, 1:29 pm

Thanks :)

"jmack007" <webforumsuser@macromedia.com> wrote in message
news:c3hjg7$r26$1@forums.macromedia.com...
> True. True.
>
> So here it is then. You can use this either within the <head> tags of

your
> HTML document and have javascript build 2 alternate HTML pages (one with

the
> swf present the other with images present) or, if your page is more

involved
> then a simple html section and a flash movie you may put the script tags

and
> the code within the <body> of your document and then just alter the HTML
> formatting within the Javascript to display the <object> and or <img> tags
> within your page inline.
>
> The VBScript is a very reliable way to include and alter content to be
> delivered to your Macintosh users that have the IE 5.5 installed. It is
> basically doing the same thing as what the Javascript checker function

array
> does to determine if flash is present and, if so, what version is present.

I
> do not know why IE5.5 for Mac chokes on Javascript checking-- I have just

found
> it does.
>
> Here is the code:
>
> <!--------- Detect for Flash 6+ OR give inline image if not

found. ---------->
>
>
> <script language="javascript" type="text/javascript">
>
> <!--
> // Variables to store player version and player presence or not.
> var MM_contentVersion = 6;
> var plugin = (navigator.mimeTypes &&
> navigator.mimeTypes["application/x-shockwave-flash"]) ?
> navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
>
>
> // See if the Flash Player is installed and activated for windows

platforms.
> 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;
> }
>
>
>
> // VBScript for Macintosh display in IE 5.5
>
>
> // Macintosh platform IE tag fix for detection script.
> else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0

&&
> (navigator.appVersion.indexOf("Win") != -1)) {
>
> //FS hide this from IE4.5 Mac by splitting the tag
> document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
> document.write('on error resume next \n');
> document.write('MM_FlashCanPlay = (
> IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." &
> MM_contentVersion)))\n');
> document.write('</SCR' + 'IPT\> \n');
> }
>
>
> // End VBScript for Macintosh display in IE 5.5
>
>
>
> // If Flash 6+ is detected-- build the page and show the SWF.
> if ( MM_FlashCanPlay ) {
> document.write('<object
> classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
> document.write('
>

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#ve
> rsion=6,0,0,0" ');
> document.write(' id="script" width="778" height="430" align="center">');
> document.write(' <param name=movie value="comingsoon.swf"> <param
> name=quality value=high> <param name=bgcolor value=#eeeeee> ');
> document.write(' <embed src="comingsoon.swf" quality=high

bgcolor=#eeeeee
> ');
> document.write(' swLiveConnect=flase width="778" height="430"
> name="script" align="center"');
> document.write(' type="application/x-shockwave-flash"
> pluginspage="http://www.macromedia.com/go/getflashplayer">');
> document.write(' </embed>');
> document.write(' </object>');
> }
>
>
> // If Flash6+ is not present-- build the page and show the jpeg image.
> else{
> document.write('<img src="comingsoon.jpg" width="778" height="430"
> usemap="#script" border=0>');
> }
>
>
> -->
>
>
> </script>
>
>
> You can modify the code to sniff for any version of the Flash Player and

you
> can also change any and all of the HTML form outputted by Javascript to

reflect
> the contents of your HTML page and generate 2 version dynamically.
>
> --jmac
>



.::Dr. J::.

2004-03-30, 9:07 pm

Thanks for the code jmac, thats good stuff.

Do you have any examples we can view online as well?

Also, do you have any code that would also detect what browser a user is using?

thx
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews