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.


In your HTML header:

<title> </title>

<!-- Include script and pass the SWF 'id' with the querystring -->
<script type="text/javascript" src="swfmousewheel.js?id=myMovieId"></script>



In AS3:

package {

	import flash.display.MovieClip;
	// 1: import SWFMouseWheel
	import com.oysteinwika.ui.SWFMouseWheel;

	public class SWFMouseWheelExample extends MovieClip {

		public function SWFMouseWheelExample() {
			// 2: init SWFMouseWheel
		// 3: SWFMouseWheelHandler function
		SWFMouseWheel.SWFMouseWheelHandler = function(_delta:Number):void {
			// your code goes here...
			// maybe something like this: 
			// scrollButton.y -= _delta*20;



Download Source Files