iPhone Readiness – Flash Detection Method

Steve —  1.4.2010 — 1 Comment

Flash Detection

When you publish your Flash content, you have the option of publishing HTML and in the associated option for HTML publishing, there are several check-boxes related to which version of the Flash Player you want to target and whether or not you want the resultant HTML to check for the presence of the specified version or above. FIG. 1 shows what you would check to get the HTML file that checks for the presence of a version of the Flash Player.

FIG. 1
Flash Settings

Provided you check the box shown in the figure and publish your content, you’ll get an HTML file that has the detection code in it. As you examine the code, you’ll see that the detection script looks for a specific minimal version of the Flash Player, not just the presence of the Flash Player. So, the detection script can “fail” for two reasons: 1) An insufficient version or 2) the absence of the Flash Player altogether.

Therefore it is a good practice to include the GetFlashPlayer icon linked to Adobe’s site in case they were sent to this page because of a version problem and not the absence of the Flash Player. I guess you could use the CSS mod outlined in the overview article to hide a <div> tag that includes the icon if you don’t want your iPhone users to see something they can’t act on.

The next step is to copy all of the detection code including the conditions to another HTML page and save it as the site’s default page – typically index.htm or default.htm. From there you can send your users to either the regular home page (successful detection) or an alternate page (failed detection). The alternate page is where you can customize an image-based version of the home page that can be seen by mobile browsers that don’t support the Flash Player as well as explain why they were sent there.

I then went a step further and set a session variable and checked it on every other page on the site that had Flash content so I could either substitute alternate content or hide the Flash content altogether. This has an inherent problem as the session will at some point time out and if the iPhone user closes Safari and comes back, they could be faced with a site that doesn’t know they are a non-Flash user.

To overcome this, you could call a modified version of the Flash Detection script on each of those pages that resets the session variable if the detection fails, but that starts to get pretty cumbersome and is why I eventually went to the SWFObject route. You can read about that method in THIS POST.

To see a site that uses this method, go to www.americanpiepizza.net – a Central Arkansas pizza joint with a killer menu.

Trackbacks and Pingbacks:

  1. Get your Website iPhone-Friendly | 3 Lefts = 1 Right - 1.4.2010

    […] you’re interested in the Flash Detection method, read THIS POST outlining it. If you’d rather employ the SWFObject method, I’ve covered it in THIS […]

Leave a Reply

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


CommentLuv badge