define('DISALLOW_FILE_EDIT', true); FlashPlayerInfo – unFocus Projects – Kevin Newman and Ken Newman

unFocus.History Keeper 2.0 (and SwfHTML) Beta 4 – Out Now!

A brand spanking new Beta 4 of unFocus.History Keeper is out, and ready for download! Download it from Google Code. (If you are wondering what happened to Beta 3 – I actually rolled that update about half way, and had it sitting in SVN for a while, but I never made the archive, or release notification.)

Sloppy change log:

Fixed Flash Player 10 PlugIn detection.
Changed license to MIT
Quick and dirty temp IE8 support (makes IE8 use the timer method).
– removed ObjectPatentMagic
– added Packed library files for Beta 4 (says RC1 in SVN, but I changed my mind, there’s more I’d like to add).
– Added svn:keywords to most files.
– Updated tests for EventManager, FlashPlayerInfo, HistoryKeeper, SwfHTML and SwfShim.
– removed WebTV code, since the entire FlashPlayerInfo script doesn’t work in WebTV anyway.
– Fixed Issue 5. Added methods for major, minor and bugfix versions, to reflect changes to the convention in Flash Player 10 – Also cleaned up issues releated to the changes in IE.
– Added getUpdateVersion for the special case Flash Player 9 updates.
– Quick fix for shimMode on SwfShim.
– Fixes IE support.
– Adds shimMode property (it’s off by default).
– Fixed typo in call to get initial hash value (deep link), which broke it.
– Updates to the HistoryKeeper Actionscript 3.0 files. These changes are generally significant.
– Added asdocs comments (to AS3 files).
– Added support for Opera’s history.navigationMode.
– Made IE8 Hack detection more robust, and IE detectin simpler.
– Initial commit of Actionscript HistoryKeeper and AS3->JS communication framework (really just an easier replacement for fscommand). All of this is pretty rough – vomit draft material.
– Some smaller code comment and formatting cleanups.
– removed problematic _createAnchor functionality. (Issue 6)
– updated IE version detect to be compatible with multi-digit versions.
– Reworked Error messages so that they make sense in FireBug and other Javascript consoles. Fixes Issue #3
– Added direct and gpu WMode values.
– Made value checking case insensitive.
– Added SVN keywords Revision and Date, and added text/javascript mime-type.
– Fixed SwfShim.

Enjoy! 🙂

unFocus.FlashPlayerInfo update for Player 10

Adobe has updated their versioning system for Flash Player. This welcome change, creates a few backward compatibility problems with FlashPlayerInfo though, since the terms I applied to each version decimal place, do not match Adobe’s new terms (they are off by one place-ish, sorta).

To address these changes I added a new set of methods to check for the new “major”, “minor” and “bugfix” version numbers, for Flash Player 10+. The old methods will return the same data it does now (Version.MajorRevision.MinorRevision.BetaVersion). The new methods will not work for older Player versions of Flash Player (or at least won’t make sense), returning the data from the new format instead ( In older players, getBugfixVersion would refer to “r” or third decimal place version number, which is what you used to look for when trying to detect something like r115. For older players you should continue to use the older getMinorRevision method. There should be no need to update your current detection routines, unless you need to target this new information. One change worth noting, will hopefully not be noticed – getVersion now returns both of MajorVersion and MinorVersion as a JavaScript Number, so that you can check against dot releases (getVersion() > 10.1). This should not affect backward compatibility.

In addition, for Flash Player 9, Adobe released 3 feature or compatibility breaking security updates with strange version names (update 3 was r115 for example, and was significant, adding H.264 and AAC support to the player). So for the special case of Player 9, I added getUpdateVersion. Since Player 9 was the only version to get the odd update versions, this really only applies to that version.

These changes also means that some of the old properties are probably useless in Player version 10+, such as the beta flags and beta version numbers, and getReleaseCode in IE. I used to infer that information from the 4th decimal place, which used to always be 0 except in beta and pre-release builds (based on my observation). In the new version number convention that 4th place is just a build number.

Here are the new methods:
[cc lang=’javascript’ ]unFocus.FlashPlayerInfo.getMajorVersion();

The updated script is in SVN, and will be in the next release.

SwfHTML will probably get a similar update as well.

A problem with Flash Player 10 version number and javascript detection

As you may have heard, Adobe recently released the first beta of Flash Player 10. It looks like unFocus.FlashPlayerInfo has been checking for single version digits, rather than multiple:
[cc lang=’javascript’ ]
_versionRaw.match(/Shockwave Flash (\d)\.(\d)/);
The fix is easy enough (I could swear I actually fixed this at one point too):
[cc lang=’javascript’ ]
_versionRaw.match(/Shockwave Flash (\d+)\.(\d+)/);
This problem doesn’t seem to be limited to just the unFocus Flash Detection script. I’ve seen other claims of failed Flash detection in other corners as well. I’d bet most of the problems are with the plugin detection scripts (Mozilla Firefox, Opera, Safari, etc.) and not with the ActiveX detection scripts (Internet Explorer), since most of the plugin detection scripts out there are using string parsing techniques, and have probably not tested with multiple digit Flash versions (since there haven’t been any until now).

I’ll see about getting a release out soon. If anyone needs any help updating anything, feel free to leave a comment, or email me.