0

Im just in need of some inspiration as to how i would go about this project and hope there is a person out there who can point me in the right direction. :-)

I am just about to start on a flash banner add, that should allow the user to spray paint an area and when they have painted 60%+ of the area something will be revealed when they release the mouse.. I have seen this done many times - but I need some advise on how this is done?

I have been googleing around for this but cant seem to find anything about it so I hope that someone on here will be able to guide me. :-)

  • 2
    [Like in this my answer](http://stackoverflow.com/questions/15353242/how-to-detect-if-the-area-was-100-painted-in-as3/15354416#15354416) for example. Base - draw a shape over a BitmapData with `BlendMode.ERASE` mode. – Vesper Mar 20 '13 at 09:13
  • Yes, that sounds like something i should just check out! ind the if statement i could just make my functions with all the actions that would happen afterwards right? :-) – steffen henriksen Mar 20 '13 at 09:24
  • Something like this, yes, but it seems that your task requires constant check if the required percent is reached, so your code can just go after painting. – Vesper Mar 20 '13 at 09:28
  • im been trying to do this the other way around - if i have made a layer that is painted and then allow the user to "just" reveal that layer when they "paint" - would that be an easier way to work around the problem? – steffen henriksen Mar 21 '13 at 09:38
  • I don't know if it'll be easier. You will have to do some mask-draw or mask-copypixels over your layer you want to be painted. Here, you just draw with erase on, and let it be, there, you will have to draw something else, with mask, probably with other tricks about that mask, and a potential to misfire is a little bigger IMHO. – Vesper Mar 21 '13 at 09:46
  • Okay - its just that after the user finish the "painting" i need the area to fall down out of the way and reveal something behind it.. – steffen henriksen Mar 21 '13 at 09:58
  • Well, a shielding bitmap is a bitmap, thus moveable. It's up to you what to do when your event is finally triggered. Just don't forget removing listeners that are responsible for painting functinality. – Vesper Mar 21 '13 at 10:02
  • well your solutions sounds the best way to do it then! :-) Im totaly new to this shielding bitmap - how to i use that? have any information about it i can read? – steffen henriksen Mar 21 '13 at 10:04
  • It's more of using logic that reading somewhere. You make a bitmap that obscures part of your image you want to paint, then you do painting as a user, then once your threshold is reached, you, say, `removeChild()` that `Bitmap` object and have all the content behind visible. – Vesper Mar 21 '13 at 10:07

0 Answers0