As for drawing a line after formel y = a*x+b

Hello!
Is there any actionscript that can draw a line after formel y = a*x+b;

where a and b is given in an input textfield.

Can someone point me to a tutorial or help me in some other way?