Object Patent Magic and a note about javascript defer

I’ve updated Object Patent Magic. It was broken for a while. It seems that doing the swap using a deferred script (which loads sooner than window.onload does) causes some problems with if you interrupt already loading content, then try to load it again (which is exactly what Patent Magic for swfs and some PNG transparency fixes are doing when you use a deferred script).

So that leaves us with some caveats; Using this method hides the movies until the page’s onload event fires, which includes downloading swf files (I did some testing to make sure it is not actually running the swf, and it doesn’t appear to be, as long as the object’s display style is set to “none” – if anyone could help me confirm that, that’d be awesome.). So as with the satay method, I’d recommend using a shim swf that can load itself quickly, then load the main swf file through that. This actually provides a nice opportunity for in swf flash version detection and upgrade prompting using Express Install.

Anyway, it’s updated and posted, so if anyone would like to give it a try, feel free.

The PatentMagic demo page is fully validating XHTML 1.1 as a bonus (using satay)

unFocus.History Keeper 2.0 Beta 1 – Out Now!

The official Google Code name is unfocus-history-keeper. You can find the latest source in SVN. I will be doing development from trunk for now, until I can get to the tags and branches and whatnot to keep things organized.

For now, here is a snapshot. I’ll call it History Keeper 2.0 Alpha 1 for now. Let’s see where this goes from here.

For the first bug, the last state gets lost in some browsers, if you leave the site and then come back using the back button. I know how to fix it, i just need the time to implement that fix. That is the only known bug, so please feel free to leave a report in the issue tracker at Google Code if you find any more.

Also of note, you will find the source for the Swf Tools in there too (SwfHTML, FlashPlayerInfo, etc.) but if you are using ExternalInterface and SwfObject, you can safely omit those files when using History Keeper. You will not find any Actionscript code in there just yet. I’m still in the process of cleaning that stuff up (which basically means that the Communication stuff is incomplete in this release).

For your convenience, you will find two compressed JavaScript files in the root of the archive, unFocus-History-p.js and unFocus-HistorySwf-p.js.

unFocus-History-p.js contains:

  • EventManager.js
  • History.js

unFocus-HistorySwf-p.js contains:

  • EventManager.js
  • History.js
  • FlashPlayerInfo.js
  • SwfUtilities.js
  • SwfHTML.js

These were compressed using Dean Edwards’s Packer (included in above listed order).

There is also a QuickLoader Object in there, that may or may not have a bunch of quirks. Feel free to test it out. It attempts to begin working on the DOM as soon as it’s ready instead of waiting for the body’s onload event to fire.

Enjoy! :-) (Download here)