Drawing straight line AS3

Hi!

In the site below is a code which draws a free hand line

With a small modification it draws a straight line instead a ffree hand line. But how can i draw straight line which is visible while moving the cursor? I want to get the same effect as for example in MS Word while drawig a straight line.