CATEGORII DOCUMENTE |
Bulgara | Ceha slovaca | Croata | Engleza | Estona | Finlandeza | Franceza |
Germana | Italiana | Letona | Lituaniana | Maghiara | Olandeza | Poloneza |
Sarba | Slovena | Spaniola | Suedeza | Turca | Ucraineana |
Horizontal cursor controlled scrolling navigation
Introduction
This tutorial will walk you through the development of a cursor controlled scrolling navigation menu. This tutorial assumes prior knowledge of flash basics like movieclips, buttons, frame actions, key frames, tweening etc. Since I know you have all that knowledge stored away somewhere we'll get started by taking a look at what you will be creating.
Step 1: Create the scrolling movieclip.
The
first thing we need to do is make the movieclip that contains the buttons we
will be scrolling. Once you get this looking good it is all down hill from here
on. In your movieclip make two layers; in the first frame of the lowest layer
add all the text or images that you want to use as buttons. Put all your
text/images in a nice straight line so they will look smooth when moving. Your
movieclip should look similar to the following if you are using images.
When
your future buttons are positioned where you like them select each image and
press F8, select button from the menu and press ok. Do this for all your
images. After you have all your buttons made select them all and press ctrl G
to group them. Make a copy of that group and paste it in frame one with the
original. Line that copy up so that it starts at the end of the
furtherest right button. You should now have one long row of buttons
that repeat, like below.
Step one was the hardest part, so why not relax a little.
Step 3: Add the actionscript.
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
These
frame actions will make your buttons loop continuously. The last bit of
actionscript makes the magic happen. 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)
if (xmousepos1-98 && ymousepos1<-33)
if (ymousepos1<-98 || ymousepos1>-33)
xmousepos2 = _xmouse;
ymousepos2 = _ymouse;
You are now most of the way finished. The only thing left for you to do is alter the numbers -98 and -33. These numbers tell the movieclip to start playing when the mouse is above or below the moveiclip. The values you use for these numbers will depend on both the size and position of your movieclip. I would just take one and change it until it worked the way you wanted and then move to the second one, starting from 0. That is about all there is to it. I would recommend you download the .fla file and take a look at it if you are having any trouble. If all else fails you can just change the buttons in my file and use it.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 934
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved