caramelson
07-18-2002, 04:36 PM
i went to your page and the automatic scrolldown menu bar was amazing. if you would be so kind to share your secrets!
bridelh
07-19-2002, 08:59 AM
G'Day,
It's no secret. I'm more than happy to share :)
Place a vertical rectangle on the stage.
Make it into a movie clip and name it mcMenu.
Select mcMenu and click "Frames" in the properties box.
Place some buttons or text on the menu so you can see it move later.
Go back to the main movie.
Draw a square or rectangle over mcMenu.
Make sure the top of the square/rectangle is in line with the top of mcMenu.
Make this square/rectangle a mask by making "Is a mask" equal "Yes" in the properties box.
Make a note of the height of this mask.
The mask will allow only a portion of the menu to show, and the menu will scroll beneath it.
Make a blank movie clip by clicking "Shapes" > "New Movie Clip"
Place the blank mc in the center of the mask.
While the blank mc is selected, click "Actions" under "behaviour" in the properties box.
Click the "+" ("Add Actions") then "Action script..." and paste the following action script into the Actionscript editor.
onClipEvent(load){
maskHeight = 108;
halfMenuHeight = _parent.mcMenu._height/2;
minMovieTravel = _parent.mcMenu._y-halfMenuHeight;
maxMovieTravel = minMovieTravel+maskHeight;
speed = 10;
}
onClipEvent(enterFrame){
top = _parent.mcMenu._y - halfMenuHeight;
bottom = _parent.mcMenu._y + halfMenuHeight;
if ( ( top - this._ymouse/speed <= minMovieTravel) && ( bottom - this._ymouse/speed>= maxMovieTravel) ){
_parent.mcMenu._y -= this._ymouse/speed;
}
}
That should be it...
The action script in the blank movie clip just moves mcMenu relative to the mouse position against the blank movie clip.
Make sure you replace the value against "maskHeight" with the mask height you were asked to note above.
Hope that helps a little.
Anyway, here is the link to download the menu system from my site. The code is very old and conformes to KM ver 3.0.
At that time there was no hitTest, and _height and _width properties had a problem, so you will see my script with absolute values. My AS experience at that time was limited, so don't laugh too loud!
http://www.bridel.org/examples5.zip
It might help you see how it was done.
Regards
Hilary
--