-
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!
-
Euhm... no reply's...
If anybody knows another way to scroll a movie with the mousewheel, that's fine too.
or a hint...
Yanie!
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|