How to show image in place of swf if flash player is not installed in browser !
plz help !
mughal_states 0 Newbie Poster
Dani AI
Generated
As asked, the cleanest, no-frills way to show an image when Flash is not available is to provide explicit fallback content that the browser will render when it cannot start the plugin. Flash is now obsolete (Adobe stopped supporting it at the end of 2020), so the long-term recommendation is to replace SWFs with HTML5/CSS/JS (video, canvas, SVG) or an emulator. If you still need to support legacy SWFs, use the object tag’s fallback and a small script for extra control.
Use the object fallback (no JavaScript required):
<object id="flash-container" data="movie.swf" type="application/x-shockwave-flash" width="640" height="360">
<img src="fallback.jpg" width="640" height="360" alt="Static fallback image">
</object> If you need to detect Flash and swap content dynamically (older IE uses ActiveX), a minimal detector:
<script>
function hasFlash(){
if (navigator.plugins && navigator.plugins["Shockwave Flash"]) return true;
try { new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); return true; }
catch(e){ return false; }
}
if (!hasFlash()) {
document.getElementById("flash-container").innerHTML =
'<img src="fallback.jpg" alt="Static fallback image" width="640" height="360">';
}
</script> Practical notes: include meaningful alt text for accessibility; set explicit width/height to avoid layout shifts; test with Flash disabled and on mobile (most phones never supported Flash). If the SWF provides interactive content, consider converting to HTML5 or using an emulator rather than a static image. Credit to for pointing to both JS- and CSS-based strategies in the thread; the object + img fallback shown here is the simplest, most compatible starting point.
JasonHippy 739 Practically a Master Poster
How to show image in place of swf if flash player is not installed in browser !
plz help !
The standard approach would be to use some javascript to check whether the users browser has flash-player installed and if not display an image instead...Do a quick google and you should find several examples of code to do this.
Unfortunately this approach can cause problems if you want your site to work properly with several different browsers, so you'll have to be careful what code/tags you're using in your javascript and HTML.
However, there is a very good platform/browser independent javascript available for embedding flash movies into web-pages called swfobject...try googling "" and you'll find it...I can't remember offhand, but that may offer a solution to your problem...I think you might be able to specify an alternate image to use if there is no flash-player installed...But I haven't looked at it or used it for a while, so I could be wrong!
Having said that, there is another far simpler way you could go about it which doesn't use javascript at all which might also do the trick! Steps are listed below:
1. Embed the flash movie in a div on your page (using the <object> tag, don't use <embed> as it is deprecated!).
2. In the css for your page, set the background image property for the div to the image you want to use if there is no flash player.
And that is it...how simple was that?
This way if the user has flash-player installed, they should see the flash movie as normal. But if they don't, they should see the background image instead..It's a simple trick I've used in the past and it completely side-steps the whole cross-browser compatibility issue!
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.