November 25, 2008

How to embed Flash and Javascript Files In HTML posts


If people say "Pictures speak a thousand words", then it would not be wrong to say that "Flash and JavaScript speak a million words".

To make a successful and attractive blog, instead of plain and simple HTML of 1980's you should occasionally add flash(.swf) files and of course must include javascript files to your posts and sidebars.
The process is very simple, almost as simple as adding an image in HTML, the only difference is there are a little more lines of code to remember/copy :)

For embeding Flash Files:
First of all embed the flash content (file), to your Googlepages.com account or anywhere which gives a direct hotlink to the file, and of course also offers a good amount of bandwidth. That is why I prefer Googlepages.com fro this because Google never sets restriction on bandwidth, although web space available per account is limited to 100MB.

Paste these code lines, where ever you want to embed the flash file.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700"
height="322">
<param name="movie" value="Name_Of_File.swf">
<param name="quality" value="high">
<embed src="http://DIRECT_LINK_OF_YOUR_FLASH_FILE.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700"
height="322"></embed>
</object>
Note: Replace everything in the blue color, with appropriate links and values.
In case your visitors do not have flash installed/enabled in their browser, they will be promted for installing it from Adobe.com

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.

How To Embed JavaScript into HTML posts

JavaScript code is typically embedded into an HTML document using the SCRIPT tag.
<script language="JavaScript">
<!--
document.write("Hello World!");
//-->
</script>
The LANGUAGE attribute is optional, but recommended.
<script language="JavaScript1.2">
Another attribute of the SCRIPT tag, SRC, can be used to include an external file containing JavaScript code rather than code embedded into the HTML:
<script language="JavaScript" src="DIRECT_LINK_OF_JAVASCRIPT_FILE.js">
</script>

You can further see this post, on "How to embed flash Clock and calendar in your blog".


7 comments:

kpopster - K said...

i think this one is not so clear, i tried it and it didn't work. the codes (below)appear but in between it, the .swf file is fine.

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="700"
height="322"> ...(this one is good)...pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="700"
height="322">

Divya Sai said...

Well just use any .swf file, like this game:

http://game.lansin.com/flash/3d.swf

and REPLACE the blue line in the code (http://DIRECT_LINK_OF_YOUR_FLASH_FILE.swf) with the above link and use it in your blog...that's it !

Anonymous said...

Can someone please help me? I would like to know how to make my flash animation .swf appear ONLY on my blog homepage and not in the rest of the pages.

Thanks,
Miky

Divya Sai said...

Yes Miky, that is certainly possible in Blogger, read this tutorial on How to show widgets only in Hompage or in any specific page

Anonymous said...

Thanks a lot! It really helped me.

Miky

Sai @ Blogger Help said...

You are welcome Miky

Mr Graves said...

What about embedding javascript games? help please - i want to embed one into a blog from Novel Games:
http://www.novelgames.com/gamelicense/codes.php?id=141

Thanks

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

comment on this post Share Your Views

Allowed HTML tags: <b>, <i> and <a>

Join and share your views with other bloggers at BloggerStop Community

Comment Like This! and Optimize your blog...

SPAMMER OF THE MONTH: www[.]MensItaly[.]com

Next Post Homepage Previous Post

Regular Readers


What They Say...

Divya Sai is the ingenious webmaster of Bloggerstop.Net. Divya is extremely patient, knowledgeable and responsive... Bloggerstop.net has an abundance of articles on creating widgets, templates, hacks and ways to make your blog search engine friendly.
- Stacey @Pets With Allergies
I stumbled onto a great site. Sai, over at Bloggerstop.net has helped me tremendously and with great patience...for any and all questions regarding computer issues. And again, THANK YOU Sai.
- Cheryl @Cmash Loves To Read

More Here...

Popular Posts

Get this widget

| © 2010 BloggerStop.net | Blogger Widgets | Template by Dicas Blogger | Enhanced By Divya Sai | Privacy Policy