A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML Menu

  1. #1
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874

    XML Menu

    Been ages since i did flash work, about a year i think so forgot a few things.

    Any to the point, my xml menu in flash. Just having a ponder over a source file from a related flash site and this small piece of code im having trouble understanding.
    Code:
    curr_item = curr_menu.attachMovie("menuitem", "item"+i+"_mc", i);
    Code:
    if (node_xml.childNodes[i].nodeName == "menu") {
    			//sets the curr_item.node_xml to curr node - curr_node = node_xml.childNodes[i] i of this loop not the first 1
    			curr_item.node_xml = curr_node;
    			// If mouse moves over or is clicked outside the menu and held down and then moves over 
    			//run the following function
    			curr_item.onRollOver = curr_item.onDragOver=function () {
    				// because its a sub menu we have to move the first item across to the right
    				var x = this._x+this._width-1;
    				//dont need to move the mc down as of yet
    				var y = this._y;
    				// runs the funtion at runtime to acctaly place it all on screen
    				GenerateMenu(curr_menu, "submenu_mc", x, y, 1000, this.node_xml);
    				//used for the highlighted effect
    				var col = new Color(this.background);
    				// the highlighted effects colour, in this case a light light grey in hexadecimal format
    				col.setRGB(0xf4faff);
    			};
    		} else {
    			// if it dont start with menu, means its not a sub menu so the submenu arrow doesnt need to  be on the button
    			curr_item.arrow._visible = false;
    			//function
    			curr_item.onRollOver = curr_item.onDragOver=function () {
    				**curr_menu.submenu_mc.removeMovieClip();**
    				var col = new Color(this.background);
    				col.setRGB(0xf4faff);
    			};
    		}
    More specifically curr_menu.submenu_mc.removeMovieClip();

    I assume it might have something to do with ondragover? I know the code works but i dont understand what mc its removing or why it has to remove it. I can post source if this piece of code doesn't explain everything thats going on. If any of my comments are wrong according to the piece of code in which its for please tell me.

    Thank you,

    Aaron
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  2. #2
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    Dont worry people figured it out...

    Deletes any sub menus of that menu if the mouse isn't over those items...
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center