Walls and locations

I’ve been using Flash for like a year and a half. I have only made like small little movies and basic web animations, nothing to big. Now, I’m trying to make a game.

I figured out how to get the character to move around the screen (thanks to the keyboard movment tutorial). But how do I make it so the sprite can’t go past certain things (graphics, buttons, and movie clips)?

Also, can I set certain ‘locations’ so when the sprite goes over a certain area, it goes to a different frame or scene?

Sorry if I sound like an idiot.

Thanks,
-Bob