davidgm
asked on
Detect whether Flash is supported and display the appropriate <div>
I need to detect whether a browser supports Flash and then display the appropriate div within a web page. The div will just contain an image link. For example:
Detect whether flash is supported
if supported:
<div id="flash">
a link to flash content web page
</div>
if not supported:
<div id="Other">
a link to non flash content page (pdf)
</div>
You quick reply is deeply appreciated.
Detect whether flash is supported
if supported:
<div id="flash">
a link to flash content web page
</div>
if not supported:
<div id="Other">
a link to non flash content page (pdf)
</div>
You quick reply is deeply appreciated.
ASKER
My intention was to display an image link that directs to the Flash page and not embed the Flash movie in the div itself, I can't seem to see how to do this with swfobject?
Grab the library here and add to your page
http://code.google.com/p/swfobject/downloads/list
Under Dynamic Publishing
http://learnswfobject.com/the-basics/
Code sample taken from the link above
http://code.google.com/p/swfobject/downloads/list
Under Dynamic Publishing
http://learnswfobject.com/the-basics/
Code sample taken from the link above
<script type="text/javascript">
swfobject.embedSWF("mymovie.swf", "flashcontent", "550px", "400px", "9");
</script>
<div id="flashcontent">
Fallback or 'alternate' content goes here.
This content will be replaced by the SWF
after SWFObject embeds it.
</div>
ASKER
OK, I did this. It works for the non Flash content. That is, it displays a link button that users can click on to view a pdf document. However, it does not work for the Flash content. Yes, it embeds the flash in the div (a small div located on an html page with lots of other content in it) but that is not what I need. If Flash is supported, I just need to put a - button link - that, when clicked on, takes to a separate html page that has the Flash file embedded in.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://code.google.com/p/swfobject/