Menu. Scrolling more that one button

In this one, I'm going to show you how to scroll more than 1 button when pressing the up/down buttons of the menu.

Introduction

Alright! There are 2 buttons that scroll the menu (more_btn and less_btn). Each of them scroll the menu with 31 pixels right now (because each menu item has that height). We need to change the amount of that. Come on! Let me show you how:

Step 1

Let's open our index.fla file and let's open the AS pan. We are interested in these lines (219,221). As you can see, everytime we release the more_btn, our menu container goes up 31 pixels. Also we have another variable, n, that counts how many times we pressed the up/down buttons. That variables helps us in stoping the menu when the maximum(last XML node) is reached.

Step 2

And now the fun part! Let's say we want to move up with 6 buttons. All we gotta do is multiply by 6 all these variables. Let's make all the changes neccesary. The lines are: 219,221,240,242,317,319,337,339.


Lines 219, 221

contNewY -= 31; becomes contNewY -= 186; (that's 31*6)


n = n+1; becomes n = n+6; (that's 1*6)


Lines 240, 242


Lines 317, 319


Lines 337, 339


Now test your movie! :) Cool, ain't it?

Conclusion

So the process is simple. It's just about multiplying correct those variables. My code will do the rest of it. I chose to multiply by 6 because the default lenght of the menu is 6 buttons. I thought you may want to scroll all of it ;) That's all! Thanks for buying my stuff! Q