Lines between points

Is there an example anywhere on drawing a line or rect between two randomly generated points?

In other words, if you have two points that are spawned at separate random coordinates on the screen is it possible to generate a new line or rect that begins at the first point and ends at the other? [import]uid: 102017 topic_id: 17723 reply_id: 317723[/import]

http://developer.anscamobile.com/content/displaynewline

local l = display.newLine(prevX,prevY,newX,newY); l:setColor(255,0,0); l:width =2 ; [import]uid: 24 topic_id: 17723 reply_id: 67529[/import]

I was so close…

Thanks! [import]uid: 102017 topic_id: 17723 reply_id: 67530[/import]