unFocus Projects

Author: Kevin Newman

  • MouseWheel on Mac

    So for some reason MouseWheel.SCROLL events don’t work on Mac OS X. There is a fix! Gabriel over at Pixel Breaker created a script which fixes it up nicely.

    The script did require some modification to get it to work with SwfHTML, since it was designed to work with SwfObject. It took very little modification to the JavaScript to make it work with any flash embedding script. The script has a register method that takes an id, and uses SwfObject’s getObjectById method to get the swf ref – I just changed the register method to take a swf reference instead of an id string, and viola! It works with anything now. While I was at it, I also took care of some errors you might get on non-mac browsers. Here’s how to use it:

    [cc lang=’javascript’ ]
    // with SwfHTML
    swfmacmousewheel.registerObject(
    unFocus.SwfUtilities.getSwfReference(“swfId”)
    );

    // with SwfObject
    swfmacmousewheel.registerObject(
    SwfObject.getObjectById(“swfId”)
    );
    [/cc]

    You can really use any method you want to get a reference to the swf object, and pass that in.

    Here is the updated swfmacmousewheel javascript file. Note, you will still need to grab the source and follow the instructions from Pixel Breaker.

  • ResponseEncoding in IIS7 for static html files in web.config

    I couldn’t find any way to set ResponseEncoding in IIS7 for static html files in web.config.

    The system.web setting using globalization doesn’t seem to fit anywhere in system.webServer like it seems like it should (someone please let me know if there is a way to do that).

    Anyway, I did find a way to sort of shove it in there:

    [cc lang=’xml’]












    [/cc]

  • Correct User IP for WordPress comments on Mosso

    Update #2: It looks like a couple of days after I posted this, the Mosso guys sent word on fresh clicks that the issue has been fixed on their end, rendering this plugin completely useless, days after I put it up. 🙂

    I stumbled across a problem running WordPress on Mosso (Rackspace Clould) servers (which I’m now quite happily running unFocus.com on 🙂 ) in the Mosso Knowledge Base, where the ip address of the user is not properly recorded in comments when running in the Mosso cluster. The knowledge based linked to a fresh clicks article, but I wanted something a little easier to maintain than an inline hack. So I rolled a quick and dirty plugin, which seems to do the trick. Here is what it does:

    [cc lang=’php’]
    < ?php /* Plugin Name: unFocus.Mosso-User-IP Plugin URI: http://www.unfocus.com/projects/ Description: A plugin to set REMOTE_ADDR on Mosso clusters to HTTP_X_CLUSTER_CLIENT_IP to fix tracking and comment posts, etc. Version: 1.0a Author: Kevin Newman Author URI: http://www.unfocus.com/projects/ */ function unFocus_MossoUserIP() { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; } add_action('init', 'unFocus_MossoUserIP'); ?>
    [/cc]

    That’s it! It just sets the regular REMOTE_ADDR value to the Mosso Server var HTTP_X_CLUSTER_CLIENT_IP. Pretty simple. 🙂 Update: I forgot to upload a zip archive. unFocus.Mosso-User-IP.zip

  • New Paint and Tetris

    I thought the site needed a new coat of paint, and so I think Tetris is in order!

    Update: Moved to a separate page.

    Click to give flash focus – arrows move, up arrow rotates.

    There’s no start button, or end to the game – and no levels or scores either. But it’s a start. 🙂

  • Quick Update – HistoryKeeper, SwfHTML, SwfShim

    Just a quick post.

    There have been a couple of fixes and changes that have gone into HistoryKeeper, SwfHTML and SwfShim that are now in the SVN trunk, as well as a few other issues that have been nailed down, and put into the issue tracker.

    Among the fixes are finally a fix for the incorrect use of Javascript Errors in SwfHTML, as well as fixing the previously unfinished SwfShim.

    Despite the fact that I can’t figure out how to pass flashvars from SwfShim to loaded AS3 based swfs, I’m still going to include it anyway, with a note about that caveat. It does solve some other issues, and adds an easy way to utilize ExpressInstall even if you are using html to embed the swf (rather than javascript). More on that in a future post.

    I’ll also be cleaning house around the site, here and on google code. I’ve already removed some old lingering (and useless) ad stuff.

    Also, since Microsoft removed the “click to activate” silliness, I went ahead and deprecated PatentMagic. It was buggy anyway.

    Check back for more updates, and hopefully, an actual release!