The first line means 'When this frame is entered'. The second line is an if statement, checking if the left side of the square is not hitting the ground, if the statement is false flash will do nothing. If it is true, flash will make the ground move right, so it appears that the man is moving left. The 3rd line is checking if the Left arrow key is down, and the 4th is making the ground move left (like I just said) if the 3rd line is true. Lines 7-9 are exactly the same as the previous ones except checking if the right side is hitting the ground and making the ground move left.
As it is true in anything Flash related, there is a wrong way and a right way to create a randomly loading background. The method I outlined above is easy, but the more efficient method I will explain in this tutorial is far easier.
Set gradient for the circle. Choose "Item" > "Line and Fill" > "Gradient Fill". Choose "Horizontal" style. Set left and right colors opposite to background rectangle. Click OK.
To publish the Flash animation choose "File" > "Export SWF File". Then choose "File" > "View HTML code". Copy the code to integrate the background with your HTML page (you have to add DIV tag manually).