powered by FreeFind
Propellerhead-Graphix

 

  Kool Clip-Art    Kool Moves and Flash - Related Tutorials

Terms of Use

            All .fun files presented on this site are original works made with Kool Moves © 2004 Propellerhead-Graphix.com PO Box 14, Capac, MI, 48014

 

Generating Javascript
Home Page
Tutorials
Generating Javascript
Tutorials
Home Page
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".
1.    To generate the javascript code with Kool Moves follow the steps below:
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>
How to:
Search this Site
To use this code on your web page, Copy it from the dialog box and paste it to your html page.
The tutorial above may involve the use of some actionscript, html, and the like, but are not necessarily intended to teach them. These tutorials are intended to familiarize new users to the Kool Moves interface and contain simplified examples of how to perform specific tasks in Kool Moves as they would relate to the use of materials from this site. Suggested examples contained within these tutorials may not necessarily be the "best" way to accomplish a task, but they do accomplish the job at hand. These tutorials are not an attempt to copy already existing tutorials. In some instances, more detailed tutorials on actionscript and the use of the Kool Moves tool are available at the Support page on the Kool Moves web site.
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".
Note: Kool Moves customizes your code automatically according to the location and attributes of the .swf file you choose at the time you generate the code. The example code below is a representation of the code that Kool Moves will produce. Some of the parameters in your code will be different. You will be required to do some editing prior to placing this javascript on your page. For information on editing this javascript see Learn to Edit your Kool Moves Generated Javascript.