Line 8: A for loop is created to loop through and attach each large image. The "i" in the loop will start off at 0 and increment by 1 (i++), while i is below 8 (i<8). If we had 10 images we would set this to i<11.
Line 9: Using the loop, each image is attached, by referencing the identifier that we gave each image MC earlier. Each image is assigned to a temporary variable called "img", that we can use as short hand to set the properties of the image.
Line 10: The image's Y position is set using it's height and multiplying it by the incrementing "i" in the loop. So since the each image is 320 in height, image0 will be placed at 0 (0x320) Y position in the "images" empty MC. Image1 will be placed 320 (1X320), Image2 will be placed at 640 (2x320) and so on, until "i" has reached 7.
Line 11: Each thumbnail is refered to using this["thumb"+i]. The For loop increments "i", so each button will be referenced.
Line 12: The temporary variable "thumb" is used to set each thumbnail to have an opacity of 60%.
Line 13: Each thumbnail is then assigned a pos (position) property which will be the position that the "images" MC will move to when the thumbnail is pressed.
Line 14: Each thumbnail is then given an onPress function.
Line 15: When the any of the thumbnails is pressed the target variable is to the position of the pos property that was set earlier. This value can then be used to move the "images" MC to it.