Unfortunately, you cannot do exactly what you hope to do with the Graphics class. Although deleting may mean that you will draw something that you have already painted with the background color, I assume that you are hoping to "draw transparency" back to the Graphics object. Drawing with alpha 0 does not draw “nothing” - you just don’t see what you are painting, because it is completely transparent.
This is what you get for working with vectors, not bitmaps. To “erase” part of a vector means that you are creating a completely new vector, something that takes some calculation, and not just sets some pixel for a specific color value. Graphics does not provide such advanced functionality, although you can certainly write your own functions for this .: P
One way is to use bitmap images:
http://www.actionscript.org/forums/showthread.php3?t=187857
http://www.actionscripts.org/forums/showthread.php3?t=149021
Another is to consider whether you can realize what you are trying to do differently; one that could use clear ().
source share