views:

36

answers:

2

Hello, i got a question.

I have a fully working flash application, made in as3. Now i dynamicly added a movieclip and i would like to be able to erase that movieclip with a eraser of some sort, my goal is to be able pick up a sponge with the mouse and then start dragging over the movieclip and erasing the parts where i dragged over it.

Anyone who can help?

+1  A: 

Looks like this might be what you're looking for:

http://www.piterwilson.com/personal/2008/05/07/bitmapdata-erasing-in-as3-with-custom-brush-shape/

Sandro
A: 

Is the background behind the MovieClip always the same? If so you can put an image of the background over the MovieClip you want to erase, and mask that image so it becomes invisible, then add a click listener that draws a circle in the mask when clicked. This way it'll look like the MovieClip is being erased.

With getPixel you can loop over the mask and detect the percentage of the MovieClip that has been erased, so you can remove the clip from stage when it's fully erased.

Bartj3