PDA

View Full Version : Headaches with sliding menu code


chrisfromcanada
04-19-2005, 11:24 PM
Well, hello all. This being my first post to this forum I thought I'd make it an easy one.

I'm trying to make a menu slide down at the top of my site. Here's what I've gotten it to do so far: www.chrishoare.ca/clientwork/martinrosen/progress

Now the way I'm doing this is the entire menu is a movieclip (menuMC), and I have an onRollover/out statement that directs flash to play the rolldown/up animation inside menuMC, which also contains the buttons. Of course this doesnt work because the buttons are contained within the movieclip. How irritating.

So I had someone very nice at another forum direct me to code it thusly:

on the menuMC:

on (rollOver)
{
_root.dropdown = 1;
}

on a blank frame in the main timeline:

onEnterFrame = function()
{
if (_root.dropdown == 1)
{
_root.menuMC._y = _root.menuMC._y + (_root.menuMCnewposition - _root.menuMC._y)/_root.speed;
}
else
{
_root.menuMC._y = _root.menuMC._y + (_root.menuMColdPosition - _root.menuMC._y)/_root.speed;
}
}


Now I understand this is essentially looping the frame and waiting for mouseover to change _root.dropdown to "1" at which point the function will execute... but within the function itself, I dont understand how this will make my movie drop down in the fashion I want. Where is it that I am entering the co-ords for the movie to startfrom and goto? Also, since I still have the entire thing (menu buttons) contained within my movieclip (menuMC) ... won't they still not function as they are inside a movieclip - I was told thats the way flash is?

Can anybody direct me to a alternate way to accomplish this seemingly simple but alltogether frustrating task of smoothly sliding down and up a menu?

Thanks in advance for you reply.

Chris