Welcome to Flashkit Kale.

One way to do would be to draw the rectangle to start off with, then add a frame and erase a little, not too much though, then add another frame and erase a little more, then just keep doing this until the rectangle has totally gone. You'll have a line of keyframes, select them all and 'right-click' and choose 'reverse frames'.

Now when you play it back it looks like it is being drawn, and not erased as you originally did it.