|
||||
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
If the Web browser supports MIME-type applications, the JavaScript writes out an EMBED tag to display the Flash animation. Otherwise, it will write an IMG tag to display only a graphic.
The OBJECT tag is invoked on any browser that supports ActiveX, regardless of which tag JavaScript writes.
Make sure that there are no line breaks in your EMBED or IMG tags, or the JavaScript will fail. If you'd like to use line breaks, you can put each line in a separate document.write() command.
Notice that the entire EMBED and IMG strings are enclosed in single quotes; this allows for double quotes to be inside of the strings, without breaking them or having to use a slash to declare each quotation mark (").
<object classid=
"clsid:D27CDB6E-AE6D-11
cf-96B8-444553540000" codebase=
"http://download.macromedia.com/pub/shockwave/
cabs/flash/ swflash.cab#version=5,0,0,0"
width="466" height="233">
<param name=movie value=
"/<Computed Value>
/Movement-joystick.swf">
<param name=quality
value=high>
<!-- begin the JavaScript -->
<SCRIPT LANGUAGE="JavaScript">
//Determine if the browser understands
the mimeTypes property and recognizes
//"application/x-shockwave-flash"...
if (navigator.mimeTypes &&
navigator.mimeTypes["application/
x-shockwave-flash"]){
//The browser can interpret mimeTypes
so write out the <embed>
</embed> tags to the document.
document.write('<embed src=
"/<Computed Value>/Movement-joystick.swf"
quality=high luginspage=
"http://www.macromedia.com/shockwave/
download/index.cgi?P1_Prod_
Version=ShockwaveFlash" type="application/
x-shockwave-flash" width="466" height="233">
</embed>');
} else {
//...browser doesn't recognize mimeTypes
so substitute the movie with a graphic
using the <IMG> tag
document.write('<IMG SRC="noflashpic.gif"
WIDTH="220" HEIGHT="110" ALT=
"Non-Flash User Picture">'); } </SCRIPT>
<!-- Close the OBJECT tag. -->
</object>
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip library by member Steve Camps. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.
This was first published in June 2007