how to draw lines in runtime and fill empty space between them?

hello
in runtime i can draw meny Crossover lines.
how can i detect the space between them and fill with different color with as3?

i want to select color and click in any closed space to fill it.(like drawing in flash)