RE: [Flashcoders] Strange Masking Bug in Flash
Peter, > when > you build the swf, the one on the left has a big block of the masked > object > showing for no reason. The glitch in the mask corresponds to certain stroke elements. In the case of your example: the strokes that form a 'Y' (to put it delicately) and that do not conform to the shape of the fill. > This is sort of a bug in flash, but I can't have been the first person to > notice it. Does anyone have any idea how we caused it? Is it just that > flash can only support masks that are simple flat color fills? > > If it's the latter, I have a follow up question, can anyone think of a > clever way to take the movieclips we are using and convert them into > monotone fills of the same exact dimensions First: Create a separate set of movieclips with the strokes intact to use as the overlays. Then for the masks: Change the stroke color to be the same as the fill, then do Modify>Shape>Convert Lines to Fills I don't really know, but there may be a way to do at least some of the above with JSFL. That would be the clever part. Regards, -Keith http://keithreinfeld.home.comcast.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Strange Masking Bug in Flash
On Thu, Jul 3, 2008 at 12:07 PM, Allandt Bik-Elliott (Receptacle) < [EMAIL PROTECTED]> wrote: > are the masks rendered as bitmaps? > Yay, thank you! I'm not sure why I didn't try this before, but you're right -- if I set cacheAsBitmap to true on the mask and the masked clip, the issue disappears. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Strange Masking Bug in Flash
For patterns on Shapes, look no further that the beginBitmapFill function. It takes a bitmap and repeats it on a Shape. You call it from the Shape's graphics functions; as follows: var bd:BitmapData = Your bitmapData of your repeatable pattern goes here; var sh:Shape = new Shape(); sh.graphics.beginBitmapFill(bd); sh.graphics.drawRoundRect(0, 0, 200, 200, 8); That will generate a square, but you can do anything with it... Hopefully, that will help though. I'm not quite sure about how to use the IDE very much. Ashim -- Random Lines 3D My online portfolio www.therandomlines.com 2008/7/4 peter ginsberg <[EMAIL PROTECTED]>: > Hoping to get some help with a bizarre bug that has been haunting > development of the current game we're working on. > > The situation is this: > We have character animations where we swap in dynamic clothing. We > developed a system where we add patterns dynamically to the clothing by > doing the following with code: > 1. Dupe the movieclip/sprite which is going to get a pattern > 2. Use the dupe as a mask on a big square sprite that has the graphic > pattern in it. > 3. Put the resulting masked element as a MULTIPLY overlay on the underlying > original clip. > > It works great in most cases EXCEPT for this bizarre issue we keep running > into where in some clips the mask is partially broken -- seemingly random > parts of the movieclip are not masked, or in other parts weird extra lines > appear, or even big blocks. > > *Sometimes* you can fix this by going into the movieclip and grouping > ungrouped graphical elements. It gets really messed up if there are more > complicated graphical elements in there (like a gradient). In these cases, > even attempts to group elements, or make them movieclips, or whatever, > doesn't seem to help much. > > I was able to create a super simple demonstration of this bug, and posted > here: > http://www.thup.com/maskbug.zip > > Surprisingly, I was able to replicate the error without any code, just > using CS3. The movieclips on the left and right are both the same, but > the one on the right has the lines and fills inside the movieclip groups > *separately*. You'll note both of these look just fine in preview, but when > you build the swf, the one on the left has a big block of the masked object > showing for no reason. > > Someone is probably going to tell me to just group items as I've done in > this example, but like I said above that doesn't always work. For some > elements nothing works at all. > > This is sort of a bug in flash, but I can't have been the first person to > notice it. Does anyone have any idea how we caused it? Is it just that > flash can only support masks that are simple flat color fills? > > If it's the latter, I have a follow up question, can anyone think of a > clever way to take the movieclips we are using and convert them into > monotone fills of the same exact dimensions (some kind of bitmapdata > conversion maybe?). > > Thanks in advance for any advice! > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Strange Masking Bug in Flash
are the masks rendered as bitmaps? On 3 Jul 2008, at 16:40, peter ginsberg wrote: Hoping to get some help with a bizarre bug that has been haunting development of the current game we're working on. The situation is this: We have character animations where we swap in dynamic clothing. We developed a system where we add patterns dynamically to the clothing by doing the following with code: 1. Dupe the movieclip/sprite which is going to get a pattern 2. Use the dupe as a mask on a big square sprite that has the graphic pattern in it. 3. Put the resulting masked element as a MULTIPLY overlay on the underlying original clip. It works great in most cases EXCEPT for this bizarre issue we keep running into where in some clips the mask is partially broken -- seemingly random parts of the movieclip are not masked, or in other parts weird extra lines appear, or even big blocks. *Sometimes* you can fix this by going into the movieclip and grouping ungrouped graphical elements. It gets really messed up if there are more complicated graphical elements in there (like a gradient). In these cases, even attempts to group elements, or make them movieclips, or whatever, doesn't seem to help much. I was able to create a super simple demonstration of this bug, and posted here: http://www.thup.com/maskbug.zip Surprisingly, I was able to replicate the error without any code, just using CS3. The movieclips on the left and right are both the same, but the one on the right has the lines and fills inside the movieclip groups *separately*. You'll note both of these look just fine in preview, but when you build the swf, the one on the left has a big block of the masked object showing for no reason. Someone is probably going to tell me to just group items as I've done in this example, but like I said above that doesn't always work. For some elements nothing works at all. This is sort of a bug in flash, but I can't have been the first person to notice it. Does anyone have any idea how we caused it? Is it just that flash can only support masks that are simple flat color fills? If it's the latter, I have a follow up question, can anyone think of a clever way to take the movieclips we are using and convert them into monotone fills of the same exact dimensions (some kind of bitmapdata conversion maybe?). Thanks in advance for any advice! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Strange Masking Bug in Flash
Hoping to get some help with a bizarre bug that has been haunting development of the current game we're working on. The situation is this: We have character animations where we swap in dynamic clothing. We developed a system where we add patterns dynamically to the clothing by doing the following with code: 1. Dupe the movieclip/sprite which is going to get a pattern 2. Use the dupe as a mask on a big square sprite that has the graphic pattern in it. 3. Put the resulting masked element as a MULTIPLY overlay on the underlying original clip. It works great in most cases EXCEPT for this bizarre issue we keep running into where in some clips the mask is partially broken -- seemingly random parts of the movieclip are not masked, or in other parts weird extra lines appear, or even big blocks. *Sometimes* you can fix this by going into the movieclip and grouping ungrouped graphical elements. It gets really messed up if there are more complicated graphical elements in there (like a gradient). In these cases, even attempts to group elements, or make them movieclips, or whatever, doesn't seem to help much. I was able to create a super simple demonstration of this bug, and posted here: http://www.thup.com/maskbug.zip Surprisingly, I was able to replicate the error without any code, just using CS3. The movieclips on the left and right are both the same, but the one on the right has the lines and fills inside the movieclip groups *separately*. You'll note both of these look just fine in preview, but when you build the swf, the one on the left has a big block of the masked object showing for no reason. Someone is probably going to tell me to just group items as I've done in this example, but like I said above that doesn't always work. For some elements nothing works at all. This is sort of a bug in flash, but I can't have been the first person to notice it. Does anyone have any idea how we caused it? Is it just that flash can only support masks that are simple flat color fills? If it's the latter, I have a follow up question, can anyone think of a clever way to take the movieclips we are using and convert them into monotone fills of the same exact dimensions (some kind of bitmapdata conversion maybe?). Thanks in advance for any advice! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders