tags:

views:

18

answers:

1

On behalf of zefrank @ pumpkins.zefrank.com:

I reported a bug to ze that if you continue to draw on the pumpkin, it will redraw the parts you already cut out. He said that if you draw any filled object in flash it will happen.

Is there another way to structure the drawing code so this doesn't happen?

Here's an example of what is happening. You start to draw at the origin and don't let up on the mouse button as you start to draw a square.

alt text

Flash completes your fill to the origin (red color is the fill color).

alt text

At this point, the mouse is at the 3rd point in the square and everything looks correct. Now as I start to draw back across the square down the "mouse drag" line, you get this:

alt text

Section A is not filled with red, and this is desired. Otherwise we wouldn't be able to ever draw any acute angle (? geometry was a long time ago) objects.

But when we cross back into our completed object, we get this:

alt text

Part B reverts to being unfilled and this is not desired (in this case, since we're carving pumpkins).

You can try it out here if this is too confusing.

Essentially, I'm trying to figure out if there's a way to have flash keep part B filled, but behave the same way during the drawing for part A.

+4  A: 

That's because of the winding mode used in Flash by default (filling an area twice un-fills it). This can be solved with the new drawing API features in Flash 10 by using the NON_ZERO winding mode.

zeh