First time here? First time here? Newsletter Signup Newsletter
Search tutorials
Author: Jeremy Bunton | Website: http://www.jeremybunton.com

Step 2: Add the actionscript.

That was a long first step, hopefully everything is working right on your nav. Now we continue on to the fun part, well..........more fun part.

When you are finished with the all-important step 2 we will add the actionscript. In frame one of the bottom layer and frame 120 (the last frame) of the top layer add

gotoAndPlay (60);

These frame actions will make your buttons loop continuously. The last bit of actionscript is what makes the whole thing work. Take your movieclip and drop it on the main time line of your movie. Give your movieclip the instance name of "scrollclip".

Right click on your scrollclip, select actions and paste this code

onClipEvent (mouseMove) {
xmousepos1 = _xmouse;
ymousepos1 = _ymouse;
if (ymousepos1>ymousepos2 && xmousepos1>-347 && xmousepos1<-282) {
if (ymousepos1-347 && xmousepos1<-282) {
if (xmousepos1<-347 || xmousepos1>-282) {
xmousepos2 = _xmouse;
ymousepos2 = _ymouse;

After adding the above script you have everything set up you need to make your nav work. You must now find the correct _xmouse coordinates to replace the -347 and -282. These two numbers represent the bounding vertical lines in which your nav responds to mouse movement. You can set these either by trial and error or using the info panel. If you choose the T and E method start at 0 with one number and at 200 with another. From there you should be able to drill down to the numbers you need. The second way is to select your movieclip right click and go to edit, open your info panel if it is not already open. Once in edit mode you can move your mouse to the left and right sides of your nav and look at the info panel to get the two numbers you need. That's all there is to it. I am now going to talk about what the code does. For some of you this may be more than you need or want to know and for others it may be quite enlightening. Having said that, feel free to skip to step four if you are not interested in knowing the logic behind the code. I will explain the code by showing a snippet and then, above telling what it does. Here we go.

» Level Intermediate

Added: 2002-08-02
Rating: 7 Votes: 49
(10 being the highest)
» Author
Jeremy Bunton is a webdeveloper, Flashkit.com fan and self proclaimed flash master in training.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.