View Full Version : Scroll Wheel
hosdank
09-06-2008, 07:13 PM
I want to be able to detect which way the scroll wheel is scrolling, not just if it is scrolling. Is there anyway I can do this? Thanks :)
Medyman
09-06-2008, 07:20 PM
Are you using AS2 or AS3?
Nevermind...lol. Blizzard, you're too good man.
BLiZZaRD
09-06-2008, 07:21 PM
//import the class
import flash.events.MouseEvent;
//this is the listener definition
addEventListener(MouseEvent.MOUSE_WHEEL,handleMous eWheel);
//and the handler
public function handleMouseWheel(event:MouseEvent){
trace(event.delta);
}
"delta" will be a number, usually 3 or -3 positive is for up movement, negative is for down scrolling. :D
hosdank
09-06-2008, 07:22 PM
Thanks so much :) :) :)
Medyman
09-06-2008, 07:26 PM
A small note: If you're coding from within the IDE, you don't need to import the MouseEvent class explicitly. The required classes will be imported automatically when you compile the SWF.
This is only true if you're coding from within the Flash IDE, however.
BLiZZaRD
09-06-2008, 07:32 PM
Are you using AS2 or AS3?
Nevermind...lol. Blizzard, you're too good man.
not any better than you, sir, just a faster typist perhaps :P
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.