Aug 31

I’ve looked through a lot of flash detection scripts and have found none that allow you to do inline flash detection (ie. test the browser and display either a piece of flash or a substitute graphic on the same page without redirecting the user). Flash 8 will supposedly come bundled with scripts to do this but in the meantime I found some javascript code that did the trick. I’ve finally got around to cleaning it up and wrapping the whole thing in a simple custom tag I call FlashIfYouCan. If you want to see it in action you can check my company homepage here (note that it only plays on the first visit and you’ll have to use the replay button after that). Unfortunately I don’t remember where I got the original javascript from or who the author was (it looks like it might have been generated from Dreamweaver because it uses the “MM_” prefix). There were no copyright notices so hopefully it’s cool to pass it along. Big thanks to whoever it was the created the original source. This is the syntax for calling the custom tag:

<cfmodule template=“FlashIfYouCan.cfm”
pathToNonFlashFile=“/images/headerHome_nonFlash.jpg”
pathToFlashFile=“/images/fishheader.swf”
AltTag=“When searching for a technology consultant, you’ll find there are a ton of fish in the sea.”
width=“785”
height=“183”
bgcolor=“##AFAFAF”
usemap=“##imagemap”
flashVersion=“7”>

It lets you specify the minimum version of Flash you require and will allow you to have an imagemap on the static graphic to emulate the flash controls. The only problem I can see with using this method w/ js is that in the unlikely event that the viewer has flash but has disabled javascript, this tag will display a placeholder graphic instead of the swf which the user COULD play. The likeliehood of this scenario seems pretty rare to me though and the value of not having to do the wacky redirect technique outweighs the downside of having a few people that will falsely fail the flash detection.

On another note, the Arizona CFUG had Greg Rewis from Macromedia at Monday’s meeting talking about Studio 8. We had about 75 people attend in person and another 50 via breeze. The archived meeting is here if you missed it- it was a three hour tour of the features in the new Studio. Flash 8 looks promising, they really improved the video codec and the enhancements for doing encoding from within Flash are nice. Honestly, I don’t get very excited about the alphachannels, live dropshadows via actionscript, and designer-centric enhancements. The most powerful addition to me seems like the CSS support in Dreamweaver. Supposedly MACR had a dedicated team working just to ensure that CSS renders correctly in all browsers and in Dreamweaver and the demo proved that they nailed it. I just hope that team got a fat Maui vacation at the end of that process because that sounds like gruelling work. Apparently MACR is en fuego sales-wise w/ Studio 8- they beat their stated goal within 4 days of accepting preorders. Way to go out w/ bang guys!

© 2005 Lights Out Production – All Rights Reserved Worldwide

Leave a Reply

preload preload preload