Line 5 - The onPress function from the previous part.
Line 6 - An IF statement is created to check to see if the variable "current" is holding the name of the "this" (home_button). If it is, that mean the button is already at a Y position of -10, so we don't need to do anything.
Line 7 - If the variable "current" is holding the name of the "this" (home_button), we set current's Y position to 0. So if, for example, "current" was holding "media_button" and the home button is pressed, the "media_button" would move to a Y position of 0.
Line 8 - setMove is set to true, so we know that we can start moving the button (more will be explained further below)
Line 9 - the content MC is told to go to the label "home"
Line 10 - Since a new button has been pressed, current needs to be set to "this" (home_button) |