How to support Flash objects in any Web browser for a Lotus Notes Domino application

When developing applications for Lotus Notes and Domino Server, developers often need to support several different Web browser versions and types. This JavaScript code from SearchDomino.com member Steve Camps shows how to support Flash objects on any Web browser that understands JavaScript or ActiveX.

When building applications for Lotus Notes and Domino Server, developers often need to support several different Web browser versions and types. The JavaScript code in this tip shows how to support Flash objects on any Web browser that understands JavaScript or ActiveX.
More JavaScript resources:
JavaScript FAQs

JavaScript Learning Guide

JavaScript Reference Center

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

Dig deeper on JavaScript for Lotus Notes Domino

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close