Thursday, March 16, 2006

I've recently started using FlashObject as my preferred Flash embedding method. For a long time I've either just used the Macromedia standard nested or used a "sniffer" swf for circumstances where I really needed to know version numbers.

I kept an eye out for alternatives and seriously looked at the Flash Satay method since it seemed to favored by many Flash experts. It was also promoted on the A List Apart site which has very high credibility. I didn't really care for it though because of the issues with streaming. Flash satay uses a small swf in an object tag that then loads the full content. This can create problems for larger flash movies where they don't play until fully loaded. A lot of my work lately involved pretty large media-centric swfs and I didn't want pay that price.

I had been skeptical of Javascript oriented methods because I used to be a lot more conservative about how much Javascript I used. But the march of progress has led to a much better browser ecosystem and combined with the Ajax stuff I've loosened up on that front.

So now we have FlashObject which hits that sweet spot of features and complexity. Flashobject works by replacing the innerHTML on a div on your page. This really fits with how I've been putting pages together lately and also allows you to have really good alternative content for situations without flash or even for search engines to index. The resulting HTML will also validate as XHTML which was always a problem with the object/embed combo.

Another advantage is the fact that this results in just one object or embed tag so you don't have problems with two things with the same name. I've recently been doing some DHTML tricks involving the flash movie and was having to either write more complicated code to figure which tag the client was using or I was having issues objects having the same name. These sound like problems that aren't too hard to work around but a lot of my work is in CMSs and I won't necessarily know which swfs are in which pages. FlashObject makes it a lot easier for me to package this functionality within my site templates.

FlashObject also supports passing parameters and variables in a nice way. Everything I've been doing lately has needed that to tie in with other CMS content. FlashObject's approach of adding them with methods really helps me keep that organized since it fits in with the templating approach much better.

One trick I'd like to try soon is to actually have the alternative content rendered in a plain html way from the CMS so that the indexing is very accurate. This will also possibly allow the site to be usable on phones, especially since I've moved to a lot more CSS driven approach. Probably won't be pretty but if you've surfed on your phone you are probably surprised when things work at all.


Post a Comment

<< Home