Three questions about my flash game

Hi all, I am making a game which is look like the classic Asteroids game,
The behaviors of asteroids spin and appears in random position, random direction, random size and so on…are already done
The spaceship movement and control already done too.

My first question is, how to make those asteroids forced to appear along a screen edge rather than accidentally appearing in the middle of the stage?

from my piece of code, I have no idea where to put the collision detection in my game.

Last question is how to create a score counter when people fire an asteroid then they will get 1 point?

Hope someone can help~
Thanks!