I've never worked with Flash before, but I need to find a way of displaying a static image if Flash is not installed or not supported. I found several methods but not seem to work (see below). Any suggestions would be greatly appreciated. My website is mostly PHP/HTML. Everything I've tried (in both IE and FF) shows the Flash movie if Flash is installed or enabled, but always shows "Click here to install the following ActiveX control: 'Adobe Flash Player' from 'Adobe Systems Incorporated'..." if Flash is not available. Here's what I've tried:

<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','928','height','141','src','/assets/flash/flash_banner','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','/assets/flash/flash_banner' ); //end AC code
</script>

<noscript>

<!-- options below -->

</noscript>

Method 1:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="928" height="141">
  <param name="movie" value="/assets/flash/flash_banner.swf" />
  <param name="quality" value="high" />
  <embed src="/assets/flash/flash_banner.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="928" height="141"></embed>
 <div><img src="/themes/views/public/default2/images/logo.jpg" width="928" height="141" alt="no flash image" title="" /></div>
</object>

Method 2:

<object type="application/x-shockwave-flash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="928" height="141">
  <param name="movie" value="/assets/flash/flash_banner.swf" />
  <param name="quality" value="high" />
<div><img src="/themes/views/public/default2/images/logo.jpg" width="928" height="141" alt="no flash image" title="" /></div>
</object>

Method 3:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="928" height="141" id="flashContent">
<param name="movie" value="/assets/flash/flash_banner.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="/assets/flash/flash_banner.swf" width="928" height="141">
<!--<![endif]-->
<img src="/themes/views/public/default2/images/logo.jpg" alt="no flash image" />
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>

Method 4:

<div id="splashintro">
<img src="/themes/views/public/default2/images/logo.jpg" />
</div>
<script type="text/javascript">
var so = new SWFObject("/assets/flash/flash_banner.swf", "my_intro", "928", "141", "8", "#338899");
so.write("splashintro");
</script>

Dani AI

Generated

— the behavior you describe (the browser showing an "install ActiveX control" prompt when Flash is absent) is caused by inserting the Flash object in a way that asks IE to offer the plugin install. The simplest, most robust pattern is: serve a plain image by default, then replace that image with the SWF only when a Flash plugin is actually present. That avoids the IE install dialog, gives a usable no-Flash fallback for everyone, and keeps layout stable.

Use a placeholder DIV that contains the static JPG as the page default, then use feature detection (or SWFObject 2.x) to embed the SWF only when available. Example (placeholder + conditional embed):

<div id="flash_banner" style="width:928px;height:141px;">
  <img src="/themes/views/public/default2/images/logo.jpg" width="928" height="141" alt="banner" />
</div>

<script>
// if you include SWFObject 2.x on the page:
if (window.swfobject && swfobject.hasFlashPlayerVersion("9.0.28")) {
  swfobject.embedSWF("/assets/flash/flash_banner.swf", "flash_banner", "928", "141", "9.0.28", null, {}, {wmode:"opaque"});
}
</script>

If you do not want an external library, do a small plugin check before inserting any object markup (so IE never sees a classid/codebase in the static HTML):

<script>
var hasFlash = false;
try { hasFlash = !!(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")); }
catch(e) { hasFlash = !!(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]); }

if (hasFlash) {
  // create and append object/embed via DOM here (only when plugin detected)
}
</script>

Notes and troubleshooting: was right to point you at SWFObject — it handles cross-browser detection and avoids that IE prompt when used to write the object client-side. If you keep using markup-based classid/codebase in the server HTML, IE will often show the installer dialog. Always include width/height and meaningful alt text for the fallback image to prevent layout shift and for accessibility. Finally, consider converting Flash content to HTML5 (canvas/CSS/MP4) — Flash is deprecated and unsupported in modern browsers, so a long-term migration is recommended.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.