Pages

Monday, October 15, 2012

How to play / embed SWF flash file on Blogger or webpage (example)

Sometimes we'd like to play flash by embedding the SWF file in the webpage or blog post (Blogger, etc). Then how can we make it happen?

I read the W3School instructions and got a few lines of codes from there.Basically the codes will call the official Shockwave Flash Player to play the SWF file.

To embed the SWF file each time when writing a post, you just need to copy the codes, paste into your webpage or post, in the example codes change the flash width, height, and the SWF file web address, that's it.

Note: before pasting the codes into the post, make sure to change your post editing mode to "HTML". Once pasted in, you can switch back to "compose" . (In blogger, it's at the top-left corner of the post editing interface)

Here's the recommended codes from W3school

<object width="600" height="400"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">

<param name="SRC" value="Your_file_web_address">
<embed src="Your_file_web_address" width="600" height="400">
</embed>
</object> 

Note:
- The highlighted items are the items need to be replaced by your actual file
- Change the values of  width and height to the actual size (px, or pixels) of your SWF flash
- Change the Your_file_web_address to your actual SWF file web address.

Example

Here's an example by using above codes, a flash game hosted on Google.

The flash file's address is https://swiffypreviews.googleusercontent.com/view/gallery/example3.swf ,  I changed the flash width to 550, height to 450, and here's we go:



The real embed codes for above game flash is as following:

    <object width="550" height="450"
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0">
    <param name="SRC" value="https://swiffypreviews.googleusercontent.com/view/gallery/example3.swf">
    <embed src="https://swiffypreviews.googleusercontent.com/view/gallery/example3.swf" width="550" height="450">
    </embed>
    </object>

Enjoy !

It's Your Turn

How do you embed SWF flash for your blog? There's any other solution to embed the flash? Share your experience and insights in the comments box below. 




No comments

Post a Comment