Line 11 - A for loop is created to loop through the items in the menu array. The "i" in the loop will start off at 0 and increment by 1 (i++), while i is below the menu's length.
Line 12 - Each sub button MC is attached, by referencing the identifier ('subButton') that we gave the button earlier. The subButton is then assigned to 'b', which we can then use to reference it.
Line 13 - When the buttons scroll down, each will appear from behind the previous one, so when they're created they need to be attached on a level below the preious button. So, the countDown variable is used on line 21 to give the subButtons a level, and then decreased by 1, for the next button appears to appear on a level below.
Line 14 - 'b' (The current subButton MC) is told to stop since it has 2 frames.
Line 15 - 16 - The subButtons are positioned at xStart and yStart, which were decalred at the top earlier.
Line 17 - A interval' property is then given to the 'b'. The interval, which was created earlier, is multiplied by 'i', so the buttons descend sequentially.
Line 18 - When the 'mainButton' is pressed, each subButton needs a target Y position to scroll down to. So the subButton height is multiplied by 'i' and then added on to the star position of the sub buttons. This valued is assigned to the target property.
Line 19 - A property is then created for each button called txt. This will hold the page, form the menu array, that the pagesMc will go to when the buttons is pressed. |