There are many ways to detect flash in a browser, but today I came across an elegant solution that I think is the best I have seen so far, and better yet – works with all browsers, and lets you expose minimal code. With around 10 lines of code you can detect flash, and set up your alternate content, etc. Pretty sweet if you ask me, especially compared to some of the hacks I have seen to try to detect the browser and OS and if flash is installed and what version and you get the picture. With FlashObject, you reference the js file, and then you set up a div tag for alt content, and a JavaScript block with your flash code (2 lines of code). It seems a lot more easier then the default shockwave EMBED method. If you have to detect flash on multiple browser, I suggest you check out FlashObject.
Categories