Production of flash level two menu

Source: Internet
Author: User
Menu | Level Two menu The menu you set up in this way requires you to refuse to use the button on (RollOut) event. Instead, use on (rollover) and flexible application of the upper button to the lower button shading.
First, this is also the most important step:
Build a big enough button (big to the whole scene). Place it at the bottom so that it can be obscured by other buttons so that its on (rollover) {} Event is not triggered when there are other buttons on it.

Its role is to close the submenu when the mouse leaves the menu. This is its code:
On (rollover) {
Hidemenu ();
}
Hidemenu function:
function Hidemenu () {
for (i) {
if (This[i].over = = True) {
This[i].gotoandplay ("Hide");
}
}
}
It searches the entire current MC (here refers to _root) and, if it is found to be open (. over = = True), lets it jump to a closed frame (. gotoAndPlay ("Hide");)
The variable. Over = True is set in the MC frame of the submenu. It indicates to the search engine that the submenu is currently open. So it's written in the 2nd frame. That is, open the submenu to play the first frame of the animation. Of course when you close the submenu (play off the submenu animation), remember to set it to over = False to indicate that the submenu is now closed. So that the search engine will not play the wrong animation.

Step Two:
You need to solve the Guaranteed submenu when the mouse moves away from the main menu and move to the submenu (that is, it is not closed by the biggest button that is placed at the bottom). So you want to add a button at the bottom of the first frame of the Play Open submenu (it's just a hidden button without any action). Added at the bottom is because it doesn't affect the submenu's buttons. The area of the button should have a little overlap with the button area of the main menu (better used) and overwrite the selection area of the submenu. It makes the buttons you create in the first step fail in this area, which means that when the user's mouse is in the area, your submenu won't be closed.

Step Three:
Add action for the button on your main menu:
On (rollover) {
Hidemenu ();
Mcmenu1.gotoandplay (2);
}
It first closes all the open submenus, and then plays the animation that opens the submenu corresponding to the current main menu. Don't write the order back.

At last
To look at your menu, which is to make the user feel that there are not so many auxiliary buttons behind them, set your auxiliary buttons (the largest first-built bottom button and the second-step button) to not use the hand cursor:
Bua.usehandcursor = false;


   Click here to download the original file to learn by yourself

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.