NAVIGATION:

 

SUPPORTERS:

FlashComponents
  Flash Templates
  Flash Gallery
  Flash Slideshow
  Flash Menu
  Flash Design
  Flash Video
  User Interface

 

FOLLOW:

RSS it down! Twitter it up! Facebook it like a fiend!

 

 

 

 

 

 

 

 
Flash 5 HTML Code

Even though Flash animation are not created in HTML, they need to have some HTML code to display the animations in a Web browser. The scroll box below contains the HTML code that Flash outputs for publishing animations.

The simplest method of displaying Flash animation in a browser is to use Macromedia's HTML file that gets generated during Publishing. It not only includes the HTML code, the code is also custom tailored to your animation. The following code is primarily for SWF programs such as Swish and Swift3D that do not export a HTML file along with an animation.

The code:

Copy the code and paste it into your HTML document. It will look cryptic to you, especially if you are not familiar with HTML. The following will help you customize the code to your movie:

Setting the movie:

To set the animation in your code, change movie.swf to the name of your movie clip. You will have to change it twice. If you look at the code, you will see that movie.swf appears after the <PARAM NAME tag and in the <EMBED src="movie.swf"  tags.

Setting the dimensions:

Now that you have the movie set up, it is time to adjust the width and height of the animation. The simplest way to change the width and the height is to find the words WIDTH= and HEIGHT= and enter the appropriate values. There are two WIDTH tags and two HEIGHT tags. Make sure you change them both or the animation will not display properly on certain browsers.

The following is an example of how one of my animations looks like after being published using the HTML file. I highlighted the tags that I modified to display the animation:

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/
WIDTH=550 HEIGHT=400>

<PARAM NAME=movie VALUE="kp.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#666666>

<EMBED src="kp.swf" quality=high bgcolor=#666666 WIDTH=550 HEIGHT=400
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?>
</EMBED>

[ The code has been modified to fit in the browser. DO NOT COPY THE CODE PASTED ABOVE. Copy the code found near the top of the page in the menu box instead. ]

I hope the information helped. If you have any questions or comments, please don't hesitate to post them on the kirupa.com Forums. Just post your question and I, or our friendly forum helpers, will help answer it.

The following is a list of related tutorial and help resources that you may find useful:

How to use the Forums
New, Upcoming, and In-Progress Tutorials
How to Help out kirupa.com
Writing Tutorials
 

Cheers!

Kirupa Chinnathambi
facebook | twitter

 

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)