Advanced Search

Results 1 to 6 of 6

Thread: Scroll Wheel

  1. #1
    Join Date
    Jul 2008
    Posts
    65
    Thanks
    42
    Thanked 0 Times in 0 Posts

    Default Scroll Wheel

    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

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Are you using AS2 or AS3?

    Edit: Nevermind...lol. Blizzard, you're too good man.

  3. #3
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Code:
    //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.
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. The Following User Says Thank You to BLiZZaRD For This Useful Post:

    hosdank (09-06-2008)

  5. #4
    Join Date
    Jul 2008
    Posts
    65
    Thanks
    42
    Thanked 0 Times in 0 Posts

    Default

    Thanks so much

  6. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    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.

  7. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,486
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Medyman View Post
    Are you using AS2 or AS3?

    Edit: Nevermind...lol. Blizzard, you're too good man.
    not any better than you, sir, just a faster typist perhaps :P
    {CWoT - Riddle } {OSTU - Psycho} {Invasion - Team}
    Follow Me on Twitter: @Negative_Chaos
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •