PDA

View Full Version : Flash or jpg



preacher28
08-15-2003, 10:39 AM
Hi guys,

What I am looking to do is have a flash banner on the top of my page but have it so that if the user doent have the flash plug-in, the banner changes to a static jpg.

I was wondering if anyone knows what codes or language is used to make this happen. I have posted this question in a few forums and no-one seems to know. Can anyone help me?

Thanks in advance.

ionsurge
08-15-2003, 12:02 PM
You have to use javascript to detect whether the user has flash or activex enabled. However it is possible to do it with php also.

Post up which method you would prefer and I'll move the topic to the corresponding forum, so you can get an answer quickly.

ACJavascript
08-20-2003, 03:30 PM
I suggest javascript :D

webmarkart
08-29-2003, 08:41 PM
here an example...



<html>
<head>
<script language="JavaScript">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v3.0
var ok=false; document.MM_returnValue = false;
with (navigator) if (appName.indexOf('Microsoft')==-1) ok=(plugins && plugins[plgIn]);
else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
else ok=autoGo; }
if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" onLoad="MM_checkPlugin('Shockwave Flash','introplay.htm','index.htm',true);return document.MM_returnValue">
Flash Detection
</body>
</html>



Links:
red has pluggin
blue doesnt

09-05-2003, 06:28 PM
Javascript is not reliable as a player detection method- what happens if someone has Javascript turned off?

More people now have the flash player installed than have Javascript turned on.

The *only* reliable way to detect Flash is to use de facto HTML and actionscript.

Stage One- Flash detection
=====================

Build a very simple one frame swf which contains no artwork, only a frame action. The frame action is this-



getURL("index2.html");


Export this movie as a Flash5 swf.

Also put a meta refresh in the head of the page this swf sites in.



<META HTTP-EQUIV="refresh"
content="5; URL=index3.html">


This stage then simply detects whether someone has the flash player installed. If they have they go to index2.html instantly. If they haven't they go to index3.html which contains the HTML version of your site via the meta refresh which kicks in after 5 seconds. Assuming they do have the flash player installed, then we go to the next stage (If you wanted to do version detection)-

Stage Two- Flash Version detection
==========================

Build another simple swf with no art just this code on frame1



version= getVersion();
space=version.indexOf(" ");
myString=version.substring(space+1, version.lemgth);
myArray=myString.split(",");
player= new Object();
player.platform=version.substring(0,space);
player.majorVersion=parseInt(myArray[0]);
player.minorVersion=parseInt(myArray[1]);
player.buildNo=parseInt(myArray[2]);
player.patchNo=parseInt(myArray[3]);
if (player.majorVersion==6) {
getURL("flash6index.html");
}else{
getURL("flash5index.html");
}


export this swf as a flash 5 movie and put it in index2.html

brothercake
09-05-2003, 07:22 PM
Ingenious :) But what happens if you have meta-refresh disabled ;)

My preferred method is no detection - include the flash <object> with redundent content inside - if a visitor doesn't have the plugin, they see the redundent content, otherwise they see the movie.

09-05-2003, 08:27 PM
Originally posted by brothercake
[B]Ingenious :) But what happens if you have meta-refresh disabled ;)

Then you're screwed ;)

OT- BTW are you the same brothercake that posts on accessifyforums? :)

webmarkart
09-06-2003, 12:07 AM
If any detection at all I use javascript... if they have turned it off than thats their problem. If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?

09-06-2003, 01:33 AM
Originally posted by webmarkart
If any detection at all I use javascript... if they have turned it off than thats their problem.

Personal choice I guess.


If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?

No, but I wouldn't expect to have to hack unnecessary crap in to make it work either.

brothercake
09-06-2003, 02:05 AM
Originally posted by [email protected]
OT- BTW are you the same brothercake that posts on accessifyforums? :)
Yeah I am :) you must be kev?

StupidRalph
11-22-2003, 05:13 AM
Originally posted by webmarkart
If you were to turn on the tv and leave it on mute would you expect it to be as entertaing?

Yes.....if you are deaf :D

katalyst
11-23-2003, 06:11 AM
may have been posted above but im too lazy to read all of it...
here's what i'd do:

within the flash file do the detect plugin thing...
if they have the plugin direct em to a page with the flash banner, if not direct em to a duplicate page only with the jpg banner...

-katalyst