A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: MouseWheel - scroll between the limits

  1. #1
    Junior Member
    Join Date
    Sep 2003
    Posts
    6

    MouseWheel - scroll between the limits

    Hello,

    I've made a movieclip which can be scrolled by the mouseWheel. The scrolling works, it's just when I try to set some boundaries, it all goes wrong:
    I've set the limits but every time it reaches those limits, you just can't scroll anymore. So when the movie has an _y of 56 or 171 it stops and that's it.

    Below you find the code, if you have any idea ... please let me know.


    mouseListener = new Object();

    mouseListener.onMouseWheel = function(delta) {
    if (_root.inhoud._y >= 56 && _root.inhoud._y <= 171){
    //inhoud = the movieclip to scroll
    trace(_root.inhoud._y);
    _root.inhoud._y += delta*7;
    }
    }

    Mouse.addListener(mouseListener);


    Thanks,
    Yanie!

  2. #2
    Junior Member
    Join Date
    Sep 2003
    Posts
    6
    Euhm... no reply's...

    If anybody knows another way to scroll a movie with the mousewheel, that's fine too.

    or a hint...

    Yanie!

  3. #3
    Junior Member
    Join Date
    Mar 2000
    Posts
    7
    Friend, try:

    Code:
    bottom = 171;
    top = 56;
    mouseListener = new Object();
    mouseListener.onMouseWheel = function(delta) {
    if (_root.inhoud._y > top-delta && _root.inhoud._y < bottom-delta{ 
    _root.inhoud._y += delta;
    }
    };
    Mouse.addListener(mouseListener);
    Pet

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center