English

How To: Add Flash files to an HTML viewer

Summary

Information provided describes how to add Flash files (.SWF) below the layer list in the HTML viewer.

Procedure

HTML Viewer consists of multiple frames and the TOCFrame contains the layer list or legend information.

  1. Create a frameset to split the TOCFrame into TOCFrame and FlashFrame. To do this, open the file 'viewer.htm' in the <website> folder in any text editor and locate the following code:

    Code:
    document.writeln('<FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="Yes" RESIZE="YES">');

    Replace the above line of code with the following:

    Code:
    document.writeln('<FRAMESET ROWS="*,151">');
    document.writeln('<FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="Yes" RESIZE="YES">');
    document.writeln('<FRAME NAME="FlashFrame" SRC="flash.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="Yes" RESIZE="YES">');
    document.writeln('</FRAMESET> ');

  2. Create a new file 'flash.htm' inside the <website> directory. Open the file in any text editor and copy the following lines of code, pasting them into the new file. 'sample.swf' is the name your .SWF file:

    Code:
    <html>
    <head>
    <title>Flash test page</title>
    </head>
    <body BGCOLOR="Silver" LEFTMARGIN=0 RIGHTMARGIN=0 TOPMARGIN=0>
    <object width="180" height="150">
    <param name="movie" value="flash/sample.swf">
    <embed src="sample.swf" width="180" height="150">
    </embed>
    </object>
    </body>
    </html>


    Note:
    The size of the <OBJECT> and the <embed> tags have been specified to be 180 by 150. This is a good size to display in the HTML viewer, but it can be increased or decreased.

  3. Copy the flash file to the <website> directory.
  4. Open the HTML viewer in a Web browser; the flash file should be displayed in the lower right frame, below the layer list.

    Note:
    To execute, the flash files need a plugin installed in the Web browser and most Web browsers have them previously installed. In case the Web browser does not have the plugin installed, design a way to prompt the user to install the missing plugin at the time you are creating the flash file.