I ran across a recent entry about MouseWheel events on Mac OS X and Flash by Christian Cantrell and realized there were at least 4 cool implementations that I was aware of. Thought I would list them out here, including a modification I made to one that I have been using and has been around for at least a year or longer now. I really like the anonymous JS function injection approaches that several of them leverage. So here they are:

Takanobu Izukawa of the Spark project:

Gabriel Bucknall – PixelBreaker – AS3.0 MouseWheel on Mac OS X

Ali Rantakari – Mac OS X Mouse Wheel Support for ActionScript 3 Flash Applications (v.2+)

Matt Giger – Simple solution for MOUSE_WHEEL events on Mac

And here is a link to download a modified version of the JavaScript portion of Gabriel “PixelBreaker” Bucknall’s solution that I worked on to fix a few issues and add some functionality grab it here. I like Gabriels version as he put together an AS2 and AS3 version, it works perfectly with SWFobject 2.1, and with my fixes, multiple items on a page. I had started working on another version that also used externalInterface to leverage the anonymous function injection approach, but given that all three other variations on this issue already provide that functionality, I didn’t want to re-invent the wheel.

Also, note that all these approaches rely on leveraging externalInterface to pass info back forth between the browser/JavaScript and Flash. If AllowScriptAccess is set to NEVER in your embed, none of these projects will work. For what its worth there is a bug thats been logged on Adobes JIRA Bug system here: http://bugs.adobe.com/jira/browse/FP-216 – that is looking for extra votes – it is related to the current inability to reliably detect what AllowScriptAccess and other HTML properties of Flash have been set to. The best solution and request is to make these items available as System.capabilities.xxxx properties available at runtime. That would be great – so make sure you check out the link and vote it up for the next release of the Flash player!

UPDATE 03.10.09 – 12:51AM: I initially uploaded an old version accidentally – doh! I’ve updated the file, which fixes some issues with multiple instances of Flash on a page. Specifically where Flash instances not registered with SWFMacMouseWheel were still preventing the default page/document scroll if you happened to be mousedover them and they were receiving input. I also included a reference to Richard “Rillkill” Rodney for his tweaks for Safari for PC in the JS and AS3 code – which I failed to note requires changes in the AS to support Safari for PC. I also made a quick change to the AS2 version and zipped them both up and added them to the downloads page. If you don’t need Safari for PC support then you can stick with the original AS files from Gabriel/Pixelbreaker. Enjoy!


3 Responses »

  1. WordPress 2.7.1 WordPress 2.7.1
    The Incutio XML-RPC PHP Library -- WordPress/2.7.1

    […] Flash MouseWheel Implementations for Mac OS X […]

  2. Firefox 3.0.7 Firefox 3.0.7 Mac OS X  10.5 Mac OS X 10.5
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv: Gecko/2009021906 Firefox/3.0.7

    Be sure to vote for the bug itself in the Adobe bug tracker:


  3. Firefox 3.0.8 Firefox 3.0.8 Mac OS X  10.5 Mac OS X 10.5
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv: Gecko/2009032608 Firefox/3.0.8

    We recently created a drag-drop component for flash and flex which not only enables the mousewheel on osx (and Safari for PC), but also improves the mouse behavior on all browsers (including IE and other PC browsers). It’s based on our javascript injection tool, so no need for external javascripts or special Embed code.