Tutorial Details
- Difficulty: Beginner
- Platform: Flash (Flash Player 9+)
- Language: HTML, JavaScript
- Software used: Adobe Flash CS5, Any Text Editor
In this Quick Tip screencast, I’ll show you how to embed your Flash SWFs in an HTML webpage using SWFObject.
Where to Get SWFObject
The latest version of SWFObject is available on its Google Code page. Grab whichever file is marked as “Featured” on this page (at time of writing, that’s version 2.2).
Watch the Screencast
The Starting HTML
For a beginner’s guide to HTML, see this tutorial.
<!DOCTYPE html> <html> <head> <title></title> </head> <body></body> </html>
The Final HTML
<!DOCTYPE html>
<html>
<head>
<title>Our HTML Page</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">swfobject.embedSWF('animation.swf', 'flash', '550', '400', '9.0.0');</script>
</head>
<body>
<div id="flash">
<p>At this moment you do not support Flash Player 9. We're sorry.</p>
</div>
</body>
</html>
Thank You
Thank you for watching, if you have any questions, feel free to comment.

Awesome!!!
Even better is swfObject for jQuery. Supper easy.
Great tip about embedding flash content. But should you always embed the swf-file directly after embedding script? Or could you for example embed script in header and insert swf-file in the body of your html-document. By the way I notice that biggest games sites wich publishes flash-games also using swfobject.
You don’t have to embed the SWF file directly after the script. You could embed the script in the header (and also in the tag) and embed the SWF file anywhere you want to.
At this moment SWFObject is the industry standard, that’s why you see it at Flash game sites, and actually everywhere else where Flash is used.
Thanks for your comment.
Sorry, something went wrong with my previous response, just read this comment.
You don’t have to embed the SWF file directly after the script. You could embed the script in the header (and also in the <head> tag) and embed the SWF file anywhere you want to.
At this moment SWFObject is the industry standard, that’s why you see it at Flash game sites, and actually everywhere else where Flash is used.
Thanks for your comment.
idi kuda evariki teledu anukunnav ra puka???
Great tips and work, thanks
in hebrew we write in opposite direction