Flash and the Scroll Wheel in the Browser

I have built many AS3 flash apps before, but on this one project I needed to enable scrolling with the mouse wheel. I added a flash scrollpane but it would not respond to the mouse wheel. So I tried adding an event listener to the entire stage to see if I could capture any mouse wheel event. No luck with that either. Countless searches turned up maybe two possible resolutions to the problem, but they did not work either.

The resolution was out there to find, but I did not find it because I didn’t use the right keywords.

The resolution revealed to me was the parameter called “wmode”. The wmode param has three values; opaque, transparent, window(default). While normally most people do not set this parameter, I have a habit of setting it due to it’s necessity when building flash widgets for various web pages. In this case, if you set wmode to either transparent or opaque, the flash will not detect the mouse scroll wheel at all. So be sure not to set this parameter. If you do set it to “window” otherwise your flash app will not detect the mouse wheel events.