SWFMouseWheel

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.

Implementation

In your HTML header:

<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>

...

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
			SWFMouseWheel._init();
			
		}
		
		// 3: SWFMouseWheelHandler function
		SWFMouseWheel.SWFMouseWheelHandler = function(_delta:Number):void {
			// your code goes here...
			// maybe something like this: 
			// scrollButton.y -= _delta*20;
		}
	
	
	}
}

Example

SWFMouseWheelExample.html

Download Source Files

swfmousewheel_1_0_alpha4.zip