Example of DisplayObject.globalToLocal()
and DisplayObject.cache()
usage. Click to begin drawing. If you draw a large number of line
segments, the animation will start to slow down or stutter due to the
amount of vector data being rendered each tick. When you release the
mouse, the vector Shape is cached, and it will animate quickly again.
When you click again, it will turn off caching in order to draw new line
segments.