XHTML and Flash

November 7th, 2006

An important part of our idat205 Creative Industries company was our use of flash in highly accessible and web standards compliant sites. Even though this was a feature of last year’s idat102 module with Dan Efergan and good website technique, I found myself put off by it all, especially favouring methods that didn’t involve anyone else’s code. Then the odd ‘Click to activate and use this control’ boxes appeared in microsoft Internet Explorer 6 and flash had to just not be used for anything important at all.

The annoying content activation box.
Flash under the ‘Click to activate and use this control’

 

However, I have discovered it really is easier to implement flash successfully than it seems.
So here’s how to do it:

Download the Script

Download the .js javascript file from http://blog.deconcept.com/swfobject/ (site is found very easily with google). Store it somewhere where your flash pages can find it.

Embed the Script

Embed the file within your page
(<script type="text/javascript" src="./swfobject.js"> </script>)

In addition I would place this above any CSS embed scripts it will get rid of the ‘FOUC’ problems discussed in
http://www.bluerobot.com/web/css/fouc.asp
.

Embed your Flash File

Finally, you create a <div> of flash alternative content, which is written over if flash is available, like so:

<div id="website_menu">
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("./flash.swf", "flash", "300", "100", "8", "#ffffff");
so.write("website_menu");
// ]]>
</script>

And that is that, the page is XHTML compliant with regards to embedding the flash and IE doesn’t stop the content from interacting. For a list of reasons why this method is good, read more into the swfobject script blog site.

Update:

I’d say the basic parameters are pretty obvious (source,title,width,height,flash version and BG colour) but since this post and after a little experimentation its possible to do a rather lot more using ‘addParam’. For example setting the WMODE to something other than the defaults.

Leave a Comment

Write your response to XHTML and Flash

You must be logged in to post a comment.

Add Add a Comment

About Me

I am a web designer/digital artist currently studying BSc Digital Art and Technology in Plymouth University. I have returned for my fourth and final year of the course following my year in an industrial placement with the web design company Neovirtua and my own freelance work.

So far I have developed a wide range of skills, from producing videos using 3D software to gaining an aptitude for learning numerous programming languages. This is all on top of my original enthusiasm for art and HTML.

Read more…

Featured Work

Puzzle Flash

Based on a couple of puzzles I received a long time ago, this flash generates a random puzzle and then jumbles the pieces up for the player to solve.

Puzzle Flash game mini screenshot The flash actionscript behind this is flexible enough to allow for any size puzzle to be created and jumbled as many times as I like. In addition to this, the difficulty of rotating pieces is also a feature.

Try out Puzzle Flash…

© Copyright 2005-2008 -- Simon R.J. Mutton, All Rights Reserved.