Webcam tracking + generating random lines (as3)

Hi all. I’m trying to write code for webcam tracking + drawing generative lines. Main idea is that person pass camera and it creates random size and colours lines. after lines fill screen up to 35%, screen become blank (as in the begining).
So my questions are:

  1. how to create random size and colours lines that appears by person tracked movement? (example could be that person is creating generative art by lines)
  2. what functions should I use to count percents of filled screen? (I want that after 35% screen become blank as in the beginning. After that it just continue process from the beginning)
    Thank you in advance.