Generate Javascript to display your Kool Moves movie on a Web Page
Use Kool Moves to generate the javascript code that adds your movie to an html page.
Objective:
One of the main reasons a lot of people purchase Kool Moves is to make and place a flash type animation on an existing web page. After you create your movie and save it as an .swf file you need to add a javascript code to your web page that references that .swf file. This tutorial explains one method in using Kool Moves to save your .swf file and quickly generate the necessary javascript code to place your .swf onto your existing web page for viewing "as is".
When you are done making your movie, create an .swf file by clicking on File > Export Movie > Save as Flash Movie. When the Save As dialog box opens, enter the name of the movie in the text box, and click the Save button to save the .swf file to a folder on your hard drive. (The default folder for Kool Moves is My Documents)
Next, create the javascript code by clicking File > Export Movie > Add to Existing Web Page. The Add to Existing Web Page dialog box will open. Choose the radial button for Copy/paste code to existing web page, click the Next button, the Copy and Paste to Existing Web Page dialog box will open, click on the folder icon, the Open dialog box will open up, select the .swf file you just created from My Documents and click the Open button. Kool Moves will create the code (similar to the one below) and place it in the text area of the Copy and paste to existing Web Page dialog box.
Javascript Code Example:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id=box width=550 height=300 codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0">
<param name="movie" value="box.swf">
<param name="quality" value="high">
<param name="play" value="true">
<param name="loop" value="true">
<param name="bgcolor" value="#ffffff">
<SCRIPT LANGUAGE=JavaScript>
<!--
var ShockMode = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave Flash"])
ShockMode = 1;
} if (ShockMode ) {
document.write('<embed src="box.swf"');
document.write(' width=550 height=300 bgcolor="#ffffff" quality="high" loop="true"');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/">');
document.write('</EMBED>');
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)) { document.write('<IMG SRC="nonflash.gif" width=550 height=300>');
}
//-->
</SCRIPT><NOEMBED><IMG SRC="nonflash.gif" width=550 height=300 BORDER=0></NOEMBED><NOSCRIPT><IMG SRC="nonflash.gif" width=550 height=300 BORDER=0></NOSCRIPT></OBJECT>
Note: Many wysiwyg editors ( like Dreamweaver, Namo Web Editor) can automatically import .swf files directly from the hard drive and write all necessary code to the html page using their own special features. This particular tutorial is for those who do not have such features available and demonstrates one of several methods available to create code for placement onto an already EXISTING web page using Kool Moves and assumes that the reader already has a web site with a web page in mind on which to place a Kool Moves movie. This tutorial does not apply to users of Microsoft Front Page. The Kool Moves help file provides more detailed information on using Front Page, generating javascript code, and explains a few other ways to produce an .swf file and add the necessary code to a web page using the File > Export feature. Open the Kool Moves Help file, click on the Search tab, and type in "Add to Web Page".