Simulate Windows XP Start menu navigation

Source: Internet
Author: User
window| Menu | Navigation Nothing to the site's navigation menu separated out, very early wrote, some methods appear to be a bit stupid, do not laugh ah. I hope to help you a little.
Idea
SWF loading external XML file dynamic generation menu
SWF File processing methods:
1, the left menu (just simple with attachmovie)
2, to produce the right menu (this trouble), where the focus is the production of multilevel menus and under what circumstances to remove the submenu
The parent node menu and the child node menu are created by XML parsing, the child node menu is generated when the parent node menu is moved, and the Sub node menu is clicked, and the corresponding processing method is called.
But how to record the child menu, we set a parent node index array to record all of the node's Child node menu index, and another two arrays to record the current index array and the parent node menu index array
facilitates other operations (such as if a menu loses focus, the menu item is deleted)
3, to determine whether the menu over the lower bounds, and adjust accordingly
4, according to the length of the menu name adaptive
5, the color settings of the menu (set by an external XML file)
That's pretty much the function.
The following is the menu XML file to load:
<mainmenu childrollbgalpha= "folderrollbgalpha=" ><menu bgcolor= "0x5c7683" wordsColor= "0x000000" Rollcolor= "0xFFFFFF"
Rollbgcolor= "0xee3f26" ptcolor= "0x000000" ptrollcolor= "0xFFFFFF" >
<submenu n= "Internet" id= "1"/> <submenu n= "My Computer id=" 2 "/> <submenu n=" e-mail "id=" newmail~auzn_1982@163. com "/> <submenu n= Control Panel" id= "3"/> <submenu n= "Search" id= "4"/> <submenu "Help and Support" n= "5" id=/> U n= "About Stationmaster" id= "6"/></menu><menu bgcolor= "0x5c7683" wordscolor= "0x000000" rollcolor= "0x000000" Rollbgcolor= "0xFFFFFF"
Ptcolor= "0x000000" ptrollcolor= "0xFFFFFF" > <menu n= "My Documents bgcolor=" 0x5c7683 "wordscolor=" 0x000000 "rollcolor=" 0x000000 "rollbgcolor=" 0x00ffff "ptcolor=" 0x000000 "ptrollcolor=" 0xFFFFFF ">
<submenu n= "My Music" id= "7"/> <submenu n= "Picture Collection" id= "8"/> <submenu n= "My Movie" id= "9"/> </menu> < Menu n= "Connect to" bgcolor= "0x5c7683" wordscolor= "0x000000" rollcolor= "0x000000" rollbgcolor= "0xffFFFF" ptcolor= "0x000000" Ptrollcolor= "0xFFFFFF" >
<submenu n= "Kingnare" id= "newweb~http://www.kingnare.com"/> <submenu n= "Kingnare Blog" id= "newWeb~http://" Www.kingnare.com/blog "/>
<submenu n= "Flash" id= "newweb~http://www.flash8.net"/> <submenu n= "The Semitic Empire Id=" newweb~http:// Www.flashempire.com "/> </menu> <menu n=" attachment "bgcolor=" 0x5c7683 "wordscolor=" 0x000000 "rollcolor=" 0x000000 "Rollbgcolor=" 0xffFFFF "ptcolor=" 0x000000 "ptrollcolor=" 0xFFFFFF ">
<menu n= "Entertainment" bgcolor= "0x5c7683" wordscolor= "0x000000" rollcolor= "0x000000" rollbgcolor= "0xffFFFF" ptcolor= " 0x000000 "ptrollcolor=" 0xFFFFFF ">
<submenu n= "Game" id= "/> <submenu n=" Recording "id=" one "/> <submenu n=" video "id=" ""/> </menu> ; submenu n= "Paint" id= "/> <submenu n=" WordPad "id="/> <submenu n= "calculator" id= ""/> </menu> &LT;SUBM ENU n= "antivirus" id= "/> <menu n=" Other "bgcolor=" 0x5c7683 "wordscolor=" 0x000000 "rollcolor=" 0x000000 "rollbgcolor=" 0xffFFFF "ptcolor=" 0x000000 "ptrollcolor=" 0xFFFFFF ">
<submenu n= "sync" id= "/> <submenu n=" Backup "id="/> <menu "n=" menu "bgcolor=" 0x5c7683 "wordscolor=" 0x000 "Rollcolor=" 0x000000 "rollbgcolor=" 0xffFFFF "
Ptcolor= "0x000000" ptrollcolor= "0xFFFFFF" > <submenu n= "menu1" id= ""/> <submenu n= "menu2" id= "a"/>
<submenu n= "menu3" id= "/> </menu> <submenu n=" restore "id="/> </menu> </menu></mainm Enu>
Mark indicates that the current record is a parent menu item, bgcolor: Background color, Wordscolor: Text color, Rollcolor: Move obsolete text color, Rollbgcolor: Move obsolete background color, Ptcolor: arrow color, Ptrollcolor: Move obsolete arrow color ( Default is not handled in SWF, you can add it yourself.
Tag indicates that the current record is a child menu item, and the property ID is used to invoke the corresponding program's
Hope that we can play some role in the study, hehe
Because too lazy, no class, if someone can make this into a class or plug-in, please send me a copy, thank you
PS: Because the security sandbox, unable to place and load xpmenu.xml files, so the SWF file in the attachment may not see the effect, please download the watch
SOURCE program See attachment: Click here to download the source file

Related Article

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.