Animating Drawing Lines

Here’s the picture of what I’m trying to achieve. You know the game Tron and the motorcycle/bike section of it where a line follows drawing the path of the bike? That is what I want to do. So to break it down into a simple example lets draw the stroke of a square. I’m not sure if this is possible with Actionscript - or with using masks how do you handle the mask on the corners?

Know what I mean?

\m/