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

Posted on 2014-11-20
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

if not supported:
<div id="Other">
a link to non flash content page (pdf)

You quick reply is deeply appreciated.
Question by:davidgm
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 58

Expert Comment

ID: 40456138

Author Comment

ID: 40456274
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?
LVL 58

Expert Comment

ID: 40456309
Grab the library here and add to your page

Under Dynamic Publishing

Code sample taken from the link above
<script type="text/javascript">
swfobject.embedSWF("mymovie.swf", "flashcontent", "550px", "400px", "9");

<div id="flashcontent">
      Fallback or 'alternate' content goes here.
      This content will be replaced by the SWF
      after SWFObject embeds it.

Open in new window


Author Comment

ID: 40457465
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.
LVL 58

Accepted Solution

Gary earned 500 total points
ID: 40457978
var version = swfobject.getFlashPlayerVersion();

// has flash
// no flash

Open in new window


Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

632 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