Link to home
Start Free TrialLog in
Avatar of basiclife
basiclife

asked on

Testing for Flash

Ok, possibly another stupid question but...

I'm writing a website that uses flash, however, I'm sure that some of my visitors won't have Flash player installed so...

Is there any way my site can query the visitors browser to find out if Flash player is installed? I'd imagine there is a way of putting a flash movie on a site and if it loads it can redirect to flash-enabled pages but if it's not installed, the visitor will be prompted to install it (or at least that's my understanding)

The site is written  so that PHP serves every page and, depending on whether or not $flash is set to 1 or 0 will serve either plain HTML or my spiced-up content. At the minute, users can select whether or not they want to view flash pages and that information is saved in a  cookie. If the visitor has cookies disabled then it will default to showing flash content (I want the defaul to be flash-enabled as most people won't bother trying to change this setting and I want a nice default look if possible)

That was quite a rambling description but I think you understand what I need.

Any help greatly appreciated. Thanks!
Avatar of Vicker Leung
Vicker Leung
Flag of Hong Kong image

basiclife~

Yeah, is me again~

Okay, actually there are a few ways of doing this

1. I think IE itself will detect =.="

2. If you use Dreamweaver to make the page, when you insert the flash into the page,
Some codes will automatically generated so that if not installed, it will redirect to the download page
The code is quoted below

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="750" height="550">
  <param name="movie" value="xxxxxx.swf">
  <param name="quality" value="high">
  <embed src="xxxxxx.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="750" height="550"></embed>
</object>

3. Using the publish function inside Flash
File Menu > Publish settings

Cheers :)
Vicker
Avatar of basiclife
basiclife

ASKER

Ah, I know you cans et it to download it id you don't have it, what I want is for my site to display alternate content if you don't have it, so my site needs to be able to query the browser directly before / while generating the page (or generate a test page that will answer the question but I'd rather avoid this if possible)
have a look at www.abracadabra.eu.com/showpage.php?page=events&flash=0&lang=en

Bear in mind this is a work in progress (actually for a balloon company for a relative that I'm playing with in my spare time, and no the colour scheme wasn't my idea :D)

The URL above should take you to the HTML version of the menu and you'll get a link to the Flash version. Because of the cookies, if you ever go back to the events page, it'll remember whether or not you chose to use flash and display the correct content. What I need is some way of deciding whether the visitor is capable of displaying Flash without prompting them to install it.

Oh, and I don't use dreamweaver / other site generators - I use a plain text editor (ok, it has some nice features, but a plain text editor nonetheless)

Cheers for the help vikker - at this rate I'm going to finance you points-wise for your next certificate 8-D
ASKER CERTIFIED SOLUTION
Avatar of Vicker Leung
Vicker Leung
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you let me know which version of Flash you are using?

If its MX2004 it has an inbuild detection mechanism which you can invoke by changing the publish settings. Let me know.

-KP
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Flash MX (6.0)
vikker: That script generator is EXCELLENT except... It doesbn't work in FireFox. Firefox is Mozilla 9ie netscape) but desn't identify itself that way. It also doesn't work in Opera, and since Firefox is my main browser, the site has to be compatible with that as well as IE and NS
nishasrilankan: Excellent link, thank you very much. As far as I can tell, however, there's no guaranteed method. Anyone know any different?
I don't know if this is what you are looking for but it has some good info.
Or you could modify it a little for your app.
http://www.kirupa.com/developer/mx/detection.htm

Fixitben
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
fixitben: I'm reading those links while I'm typing this so it may be wrong soon but... I've been told by a number of different ppl that the only 100% reliable way is using a test page as a redirect - IE if there's flash it'll go to URL 1 using a Flash object designed for that purpose, otherwise it'll timeout and go to URL 2
Hmmm. Looks like the detection script will work MOST of the time. I think I'm going to have to settle for that

If there are any better suggestions let them come now otherwise I'll split the points tomorrow.

Cheers for all your help guys