This content has been marked as final. Show 7 replies
Ahhh my friend you can't do nested rollovers in as 2.0.
A way around it that I always used was to use movieclips. Create your base button as a movie clip with 10 frames. The first 5 the closed state and the next five the open other buttons state, like a submenu. Stop commands and labels at the beginning and end. When you rollover the main button you placed inside this movieclip with 2 states, we'll call it buttonA, it goes and plays the second half of the movieclip "over" we'll call it.
Then your other buttons that just appeared in the over state can have actions as well.
To get back to the "out" "up" state of button A, you'll have a movie clip in the background that takes up the whole stage. Place it on the lowest layer and call it something like "rollout_mc" for the instance name. Now give it actions saying that onRollOver the your movie clip to go back to the beginning of the frames where the other buttons are hidden.
Now the only problem is your rollout_mc will capture you rolling over it before you get to your other buttons. So place another movieclip over the rollout_mc and call it something like submenuBackground_mc. This will just block the rollout_mc from working in the area where the user would drag their mouse.
Make sure you're rollout_mc is only in the second half of your movie, the "over" state.
This is how I was taught to replicate nested rollovers, because they are not available in AS 2.0.
If you have any qestions feel free to contact me.
Thanks for the quick response.
I think I kind of understand. The buttons are set up as movieclips.
Is it possible to do the nested rollovers in AS3.0 or would I run into the same issue?
if the MovieClip that is at the higher depth has events attached to it, it will capture all the events, and anything nested in it, will not be able to have any events... However, you can use a hitTest() to bypass that.
If I use the hitTest() will I be able to see the nested rollover?
What exactly is a hitTest
If you use the hitTest, your nested clips will be able to receive events. Look it up in the Flash Help docs, or google it.
or use AS 3.0, I think it does do nested rollovers, but I haven't tried it yet.
OK. Thanks for all the help.