views:

20

answers:

2

i have a flash video called abc.swf that i would like to play when a user first registers to our website. however, if the user does not have flash, i need it to tell them that in an easy way.

for this reason, i am trying to tell them how to download flash with the following html:

<div style="text-align:center;"> 
    <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
    <p><strong>Click below to install the latest version and then try again.</strong></p>
    <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer"&gt;
        <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
    </a></p>
</div>

the hard part (for me, hopefully not for you ^^) is getting it to show ONLY when they do not have flash installed. here is what i have so far:

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
                codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                width="720" height="488" id="xxx" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="abc.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="gpu" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="abc.swf" quality="high" wmode="gpu" bgcolor="#ffffff" 
            width="720" height="488" name="abc" 
            align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" 
            pluginspage="http://www.adobe.com/go/getflashplayer" />
            <div style="text-align:center;"> 
                <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
                <p><strong>Click below to install the latest version and then try again.</strong></p>
                <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer"&gt;
                    <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
                </a></p>
           </div>
</object>

but it shows the download flash message regardless of whether they have flash installed or not, AND it shows up under the video (or where the video would be if flash was installed).

is there a way to do this? thanks!

A: 

you should create the object dynamicly using javascript and then check if the object loaded successfully if it didn't then print your message to the screen.

dmig
+2  A: 

You could use SWFObject:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("abc.swf", "flashcontent", "720", "488", "10.0.0")
</script>

<div id="flashcontent">
<p><strong>You do not have Flash installed, or it is older than the required 10.0.0. </strong></p>
<p><strong>Click below to install the latest version and then try again.</strong></p>
<p><a target="_blank" href="https://www.adobe.com/go/getflashplayer"&gt;
<img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
</a></p>
</div>

Just download swfobject and place in the same directory. Then copy and paste this code onto your page and it should do what you want.

bloots
that looks incredibly easy. thanks so much!
Garrett