Newbie Help

Hi im new to these fourms and i was wondering if anyone could help me solve my problem. Im very to new to action script and i have been trying to learn to use 2.0. My game is simple game where you are a block at the bottom of the screen and you have to move side to side to avoid larger blocks that are falling from above. Now the only problem is that i am very nw to action script so i have no idea of the code i need to insert in my MC. So far i have been able to make the players block move from side to side with the arrow keys and make a block fall from the top with this very pathetic script i found out:

onClipEvent(EnterFrame) {
this._x += 5
}

I was wondering if anyone could give me some code so that the players block will stop moving when it hits the side of the stage and that the block that falls down will apper at the top again but with a random Y position on the stage. Thank you for any help,
best regards Pierre.:afro: