Why Microsoft actually did the Flash Dev. community a favor

Remember about a year or so ago, the whole uproar over the Microsoft EOLAS lawsuit and how Microsoft broke the web? Well, the web is still here, and as far as I am concerned it’s a better place because of it – and we should give Billy and the crew a big thanks. Why thank him you ask? Didn’t that one decision make thousands if not hundreds of thousands of websites add yet another blockade to the user viewing dynamic and interactive content? Yes it did, but it also forced the development community as a whole to start looking at existing technologies and alternatives to the <embed> tag problem that has existed since its inception.

SWFObject

Enter SWFObject, the best solution on the web for displaying Flash content within a page. You can argue this if you like, but it will be a one person argument with yourself – since you would be wrong to disagree with me. I’ve written about using SWF Object to maintain the integrity of your site, especially since the SWF may wind up in the search results being linked do directly, but this isn’t about that. It’s about the venerable SEO. Yes, an acronym! Search engine optimization is an important part of building any site, regardless if it find its roots in Flash or not, so why not get the most out of your site?

We all know by now that search engines can get inside your swf file and see the text, and that it’s a good idea to give that text a good face to be read – so what you want to convey gets conveyed, not gotoAndPlay(this.fatch). SWFObject performs the task of creating an environment where you can have the best of both worlds – a arse kickin awesome Flash site chock full of animated interactive goodness, and the best laid path of keywords, links and alternative text that a brain can produce; and the best part is that it’s super easy to do.

Lay it out

First, simply create your Flash file and the page it sits in, the place the SWFObject  code within the page:

<center>
    <div id="mainFlashUI"></div>
</center>
        <script type="text/javascript">
            // <![CDATA[
               
                    var so = new SWFObject("mainUI_Loader.swf", "kickin flash site", "750", "625", "8", "#FFFFFF");
                    so.addParam("quality", "high");
                    so.addParam("wmode", "transparent");
                    so.addParam("scale", "noscale");
                    so.addParam("allowScriptAccess", "always");
                    so.addVariable("sectionJump", "true");
                    so.addVariable("destination", 1);
                    so.addVariable("countryCode", "US");
                    so.write("mainFlashUI");
                   
            // ]]>
        </script>

The easy part is the fact that any code or images you place inside the<div> with the flashUI id will be overwritten when so.write fires, which happens after the spiders have crawled your content. If you want to see it in action, take a look at the Zippo 75th Anniversary Microsite. Every bit of information that you have access to from within the Flash site is accessible with flash not being detected or installed. As long as the viewer has JavaScript enabled, SWFObject will fire and work flawlessly. There are nearly 200 lines of code within the index file, but when you visit the page and the Flash file is written, it’s really only processing the 64 lines without all of the standard data within that <div>, and it does it fast! You can easily add variables to pass to the Flash file, as well as adjust the standard parameter set by using so.addVariable and so.addParam. This also makes it really easy to pass cookie information directly to the Flash file with very little mucking around.

No reason not too

It’s so simple and reliable to get this done, there’s no reason not to. In fact you’re doing you site and users a disfavor by not using this code to implement your Flash sites. So change it. Now! There are plenty of examples on how to use SWFObject various ways on deconcept, so there isn’t much of a learning curve to it, and if you’re in San Francisco – give Geoff a warm welcome when he gets there….

Oh yeah, and thanks again to Microsoft for getting their arse handed to them in a hat – it makes us all very happy…..

%d bloggers like this: