w3schools    w3Schools
Search W3Schools :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
Flash Tutorial
Flash HOME
Flash Introduction
Flash How To
Flash in HTML
Flash Tweening
Flash GuideTween
Flash TintTween
Flash ShapeTween
Flash Button 1
Flash Button 2
Flash Animation
Flash Sound

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Tutorials
W3Schools Forum

Helping W3Schools

 

Flash in HTML

home next

Flash Embedded in HTML

After creating a Flash movie you choose File > Save As from the top menu to save your movie. Save the file as "Somefilename.fla". 

To embed the Flash movie you just made into an HTML page, you should go back to your Flash program and do the following steps:

Step 1
Choose File > Open. Open a Flash movie you have created.

Step 2
Choose File > Export Movie.

Step 3
Name the file "somefilename.swf". Choose the location where the file is to be stored (in your Web folder). Click OK.

Step 4
Open the HTML page where you want to insert your Flash movie. Insert this code:

<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

Note: This is the minimum code you need to embed a Flash movie in a browser. A broken icon will appear on the Web page if the user does not have the Flash plug-in installed.

Note: In the code above there is both an <embed> tag and an <object> tag. This is because the <object> tag is recognized by Internet Explorer, and Netscape recognizes the <embed> tag and ignores the <object> tag.

Step 5
Type in the address of the HTML file in your browser and look at your first Flash movie.


Let the Flash Program do the Work

The code above is the absolute minimum code to embed Flash movies in HTML pages. It is not recommended to use the minimum code. There should be a few more attributes added:

  • classid is an attribute to the <object> tag. It tells Internet Explorer to load the ActiveX plug-in if it is not installed
  • pluginspage is an attribute to the <embed> tag. It displays a link to the Shockwave download page if Netscape does not have it 

The Flash program can add these attributes for you:

Step 1
Choose File > Publish. Flash will now create the <object>, <param>, and <embed> tags for you. It will also create the classid and pluginspage attributes.

Step 2
Open the HTML document that Flash created, view the HTML source and copy the code into your HTML page where you want your Flash movie.

Step 3
Be sure that you have the "somefilename.swf" in your Web folder.

Step 4
Type in the address of the HTML file in your browser and look at your first Flash movie.


home next


DreamTemplate



diploma   

Get Your Diploma!

W3Schools' Online Certification Program is the perfect solution for busy professionals who need to balance work, family, and career building.

The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.

The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.

The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.

The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.

The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).


 
WEB HOSTING
Web charting
Web based charting
for ASP.NET
$15 Domain Name
Registration
Save $20 / year!
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting
WEB BUILDING
Website Templates
Flash Templates
Website Builder
Internet Business Opportunity
Custom Programming
FREE Trial or Demo
Web Content Manager
Forms,Web Alerts,RSS
Download XML editor
FREE Flash Website
FREE Web Templates
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification
Home HOME or Top of Page Validate   Validate   W3C-WAI level A conformance icon Printer Friendly  Printer Friendly

W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright 1999-2009 by Refsnes Data. All Rights Reserved.