Gradient and boundaries

Hey, I just started with flash mx about 2 weeks ago. I’ve gotten ok at it but i have 2 questions. Is there a way to use gradient? And you know that example maze thing that flash mx came with? I understand how they did the moving block thing but how did they do those boundaries, so you can’t just jump through walls and stuff?