Question : Need help on rollover buttons in flash in Flash CS4 and AS 3

I am creating a website for a client and they want a partial flash website. I'm a newbie when it comes to flash but I've tried to create the flash content they want. One part was a slideshow which I created easily, the second part were a series of flash buttons, one for each product catogory. When the button is rolled over to clicked a "drop down menu" should animate out from the button listing the products in that catogory. When the product name is clicked it should link to the corosponding (HTML) product page.
I was able to make everything appear the way they want, but I'm having an issue with my buttons. They are lined up vertically and I need the "drop down menu" to animate out when a new button is rolled over or clicked. I'm having a hard time getting this to happen. I'm also having an issue with keeping the "drop down menu" on the screen if the user accidently moves off the button when trying to click on one of the products. Ive attached an abreviated version of my FLA file. I only have 3 buttons working, but hopfully you can see what I mean. Any suggustions for improvment would be greatly appreciated. Remember, I'm pretty new to flash, so be easy one me!
 
FLA file of my buttons
 

Answer : Need help on rollover buttons in flash in Flash CS4 and AS 3

There are many ways to achieve drop down menu effects, most of which require some kind of tweak. You can use button effects, or roll over and roll out events like what you did. THe problem with your code is the interactions between buttons are quite unclear, for instance you add event RollOver of the Surface button to a function called floorOut. When it's true that when you roll over surface button, you want the floor button to close , however the way event handlers are added everywhere introduces high coupling code, and logic errors.

I've modified your code a little bit and and the effects are quite ok. There's a small bug though, that is sometimes when you move mouse over and out of the button too quickly, it can end up having the mouse over the button but the menu isn't open. I can live with that. It is fixable but maybe not worth the effort. Not sure about your client though.
Random Solutions  
 
programming4us programming4us