Hi. I figured out the code below to make a movie clip scroll up and down. However, the problem is that it will keep scrolling forever. Does anyone know how I can get it to stop at a minimum and maximum vertical height?
var scrollUp = function() {
test_mc.onEnterFrame = function() {
this._y -= 5;
}
};
var scrollDown = function() {
test_mc.onEnterFrame = function() {
this._y += 5;
}
};
scrollup_mc.onRollOver = function() {
scrollUp();
};
scrollup_mc.onRollOut = function() {
delete test_mc.onEnterFrame;
};
scrolldown_mc.onRollOver = function() {
scrollDown();
};
scrolldown_mc.onRollOut = function() {
delete test_mc.onEnterFrame;
};