Solved

Detect whether Flash is supported and display the appropriate <div>

Posted on 2014-11-20
5
72 Views
Last Modified: 2014-12-05
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.
0
Comment
Question by:davidgm
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
0
 

Author Comment

by:davidgm
Comment Utility
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?
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
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
<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>

Open in new window

0
 

Author Comment

by:davidgm
Comment Utility
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.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
<script>
var version = swfobject.getFlashPlayerVersion();

if(version.major>0){
// has flash
}
else{
// no flash
}
</script>

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now