I figured it out, you have to add the line to the stage using, in this case:
However I have a new problem: the line is supposed to follow things on the stage, and every frame, it makes a new line. Does anybody know how to prevent this?
By default a movieclip will loop. You just need to put a stop(); in the frame script (anywhere) to tell Flash not to run the code over and over.