Flash MouseWheel on Mac Os, Windows and Linux.
SWFMouseWheel is an open source cross-platform solution for using the mousewheel in Flash, and an alternative to the mouseWheel Event in ActionScript. It is published under the MIT Lisence.
SWFMouseWheel was developed to fix mousewheel functionality for Flash apps on Mac OS, which doesn't have native mousewheel support. It's done by setting up an ExternalInterface between ActionScript and JavaScript, that listens to mousewheel events in the DOM.
We're still in alpha mode, so use at own risk.
<html> <head> <title> </title> <!-- Include script and pass the SWF 'id' with the querystring --> <script type="text/javascript" src="swfmousewheel.js?id=myMovieId"></script> </head> <body> ...
package {
import flash.display.MovieClip;
// 1: import SWFMouseWheel
import com.oysteinwika.ui.SWFMouseWheel;
public class SWFMouseWheelExample extends MovieClip {
public function SWFMouseWheelExample() {
// 2: init SWFMouseWheel
SWFMouseWheel._init();
}
// 3: SWFMouseWheelHandler function
SWFMouseWheel.SWFMouseWheelHandler = function(_delta:Number):void {
// your code goes here...
// maybe something like this:
// scrollButton.y -= _delta*20;
}
}
}
http://code.google.com/p/swfmousewheel/
SWFMouseWheel will be released in two versions: One stand alone version, and another plug-in version to SWFObject 2.0 (not released yet).
All for now :)
Øystein Wika
http://oysteinwika.com