PDA

View Full Version : Vertically Scrolling Menu/MC HELP PLEASE!!



RickHoeye
July 8th, 2005, 07:22 AM
Can someone please tell me how to set the up and down boundaries for a vertically scrolling MC?

I have the up/down buttons working fine - the mc scrolls both ways vertically but doesn't stop in either direction.

Here's what I have for AS now:

up_btn.onRelease = function(){
buttons._y -=57;
};

down_btn.onRelease = function(){
buttons._y +=57;
};

Is it a onClipEvent that sets the top and bottom coordinates or is there anything I use within the button functions (above)?

If anyone has the entire actionscript I need it'd be GREATLY appreciated!!

Just as an FYI, there are 13 buttons, 55 px in height (2 px between them), with probably 5 showing at one time (masked). Need the menu to stop at the top most button and stop when scrolling to the bottom. I know this has got to be simple though..

HELP PLEASE!! thanks in advance!

Lindquist
July 8th, 2005, 01:35 PM
Here's the logic for you to mess around with:



var upLimit:Number = 0;
var downLimit:Number = 500;

up_btn.onRelease = function(){
if(buttons._y>upLimit){
buttons._y -=57;
}
};

down_btn.onRelease = function(){
if(buttons._y<downLimit){
buttons._y +=57;
}
};