MouseWheelFix for Flash/Flex
MouseWheelFix enable/fix for Flash/Flex
For a long time the scroll wheel functionality has been broken on certain platforms. We have created an effective and easy to implement solution to this problem so we dare to say that this is the ultimate solution to that problem.
Let your designs take advantage of the scrollwheel for every platform.

Who is it for?
The lack of support for the scrollwheel on several platforms is annoying to end users. In our opinion it seriously limits the usability of applications and interactive designs. For you as an interactive designer this usualy means the scrollwheel is a area that is neglected. With MouseWheelFix you can now easily enable the mouse wheel, forget about its implentation and focus on the design requirements.
Enabling
Whether you wish to utilize scrolling for the standard textfield, for the build-in components or your own custom build interfaces MouseWheelFix makes it trivial. You can work with these objects as if the scrollwheel natively works.
Fixing
In addition to enabling mouse wheel support for OS X and Safari on PC the component can also be set to 'repair' the - in our opinion - broken default behavior. This behavior becomes apparent when an SWF is embedded on a page that is longer then the height of the window. Scrollwheel support under these curcomstances makes usablitity actually worse and you can fix that now with this solution.
Efficient
MouseWheelFix uses some very efficient actionscript that does not depend on mousemove events or traversing movieclips as is common in other solutions.
Besides a few kilobytes, enabling does not impact performance for systems that can do scrolling natively.

Great! So, how does this actually work?
Enabling scrollwheel support couldn't be simpler. You as a designer/developer just add the component to your project and tell it to enable. After compilation you'll have scrollwheel support on platforms that previously didn't. There is NO NEED to embed javascript in your HTML thanks to our swfJavascript solution.
You can now simply attach normal event listeners to any object you wish. The build-in components and textfield work out of the box.
Usage
After you have included the component into your project it is very easy to enable mouse wheel support.
Just do an import statement and use an static method to enable it. You can then safely assume any code that listens to the MouseEvent.SCROLL_WHEEL event will work. You can now continue developing your project.
By the way... It is not required to call the enable method on application start. It can be called at anytime you wish as long as the this.stage property is a valid reference to the Stage. Note that in some cases, most notably the FlexEvent.CREATION_COMPLETE event, the 'this' instance has not been added as a child of the parent and therefore this.stage is not a valid reference to the Stage.
import com.zillizi.MouseWheelFix; MouseWheelFix.enable(this.stage); // now forget about this and continue coding ...
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="onApplicationComplete(event);">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import com.zillizi.MouseWheelFix;
private function onApplicationComplete(e:FlexEvent):void {
MouseWheelFix.enable(this.stage);
// now forget about this and continue coding ...
}
]]>
</mx:Script>
</mx:Application>
| MouseWheelFix Class Methods and Constants |
| MouseWheelFix.VERSION : String = "1.0.1" |
|
Static constant defining the version of the API. |
| MouseWheelFix.NORMAL : String = "NORMAL" |
|
Static constant defining the default mode in which MouseWheelFix can operate. |
| MouseWheelFix.SMART : String = "SMART" |
|
Static constant defining a 'smart' mode in which MouseWheelFix can operate. |
| MouseWheelFix.enable(stage:Stage, browserscrollMode:String=MouseWheelFix.NORMAL]):Boolean |
Static method that attempts to enable mouse wheel support on systems that do not do so by default. It will return a boolean indicating its success.
|
Installation of the component
Flash CS3/CS4
- Double click MouseWheelFix.mxp to have the component installed to the Flash components panel by the Extension Manager.
- Restart Flash and drag the component from the components panel to your project library. You do not need to place the component on the stage.
Flex Builder 3
- Place the MouseWheelFix.swc file in a directory (convention calls it 'libs') in your Flex project.
- Add that directory to the Flex Library Build Path in project properties.
Note: when you use Flash to compile your projects and use Flex Builder as an IDE, we recommend you to also install the Flex version of the component to avoid compile errors and enable code completion within the Flex IDE.
Requirements
- Actionscript 3
- Flex Builder 3 or Flash CS3/CS4 to use the components.
- Compatible with all major browsers that support the External API. These browsers must have javascript enabled.