Hello wizards,
I am trying to make a simple scrolling thumbnail menu for some photos.
I used the following script (tutorial) to add the movement functions to the up and down buttons, which have instance names "moveUp" and '"moveDown".
The thumbnails are in a vertical looking MC named "rocket".
I have no problem scrolling up and down, but I want to limit the functionality of the buttons when the rocket is between coordinates Y=0 and Y=-1200
How can I add that to this script?
Code:
moveUp.onPress = function() {
rocket.onEnterFrame = function() {
this._y -= 18;
}
}
moveUp.onRelease = function() {
delete rocket.onEnterFrame;
}
//
moveDown.onPress = function() {
rocket.onEnterFrame = function() {
this._y -= -18;
}
moveDown.onRelease = function() {
delete rocket.onEnterFrame;
}
//
moveUp.onReleaseOutside = function() {
delete rocket.onEnterFrame;
}
moveDown.onReleaseOutside = function() {
delete rocket.onEnterFrame;
}
I actually tried to use the following code to stop the movement but it doesn't work because you can pass the limit assigned and it only gets back after another click.
Code:
//
if (rocket._y > 0) {
rocket._y = 0;
}
}
if (rocket._y < -1200) {
rocket._y = -1200;
}
Please help me find a solution,
Thanks!!
Tigran