Line 12: The loadMapData function is created.
Line 13 : The XML is loaded as array, which we will loop through and use the "buttonName" attributes to create new instances of teh button MC. So, a FOR loop is created to loop though each childnode <menu buttonName>. The firstChild is <menu> from the XML file we create earlier.
Line 14: A temporary variable, "bn", is created to hold each "buttonName" attribute. So for the first iteration in the loop, bn will equal "About".
Line 15: A temporary variable, "b", is created to hold each button that's attached to the _root. The bn variable is used to give a unique instance name to each button.
Line 16: The "b" variable is used to set the X position of the button, which will be the same for each one.
Line 17: The Y position is set for each button, using the the increment "i" to multiply the height of the button (bHeight). This will make each button created be placed lowe down than the previous one.
Line 18: We use the "buttonName" attribute (bn) to assign the button text "b.txt". Remember we set the Var of the button MC to txt earlier?