Tuesday, November 08, 2005

the loss of my mousewheel in Flash

One of few things that i dislike about a full flash site is the fact that i loose my mousewheel functionality as soon as the flash movie has focus (clicked on)
Today i made a little thingy that passes the scrollwheel functionality to the browser, using javascript.

Here's the code:

function _InitMouseWheel(){
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta)
{
getURL("javascript:window.scrollBy(0,"+-(delta*30)+");");
}
Mouse.addListener(mouseListener);
}

then somewhere in your code add :

_InitMouseWheel();

You only have to call it once (because of the listener...)

enjoy!

3 Comments:

Anonymous Anonymous said...

you save my life with this trick !!

6:02 PM  
Anonymous Anonymous said...

you make such a nice script by which both grid scrollers and page scrollers damn works fine! nice work man

7:31 AM  
Anonymous Anonymous said...

nice solution :D!

6:20 AM  

Post a Comment

<< Home