can someone point me to a sample code to draw a closed object on the canvas.
what i want is to be able to draw on the stage using mouse and only if the object is closed, then it should fill some color, else the object draw should disappear.
what i want is very much similar to what is done in the gravity master game.
http://www.gravitymaster.net/gravity-master-v1/

please help.