Weird bug involving graphics.beginBitmapFill()

I’ve been fooling around with bitmaps lately, and I’ve come across an odd issue:

I have a BitmapData object, which is drawn in two Shape objects onstage using graphics.beginBitmapFill() and graphics.endFill(). These two Shape objects appear and disappear at different times, in different order. Sometimes, one of the Shapes will fail to draw the bitmap fill. When this happens, this Shape is always the second Shape to show up onscreen. However, if I tell it to draw a clone of the BitmapData object rather than the BitmapData object itself, or if I tell it to use another BitmapData object and copy pixels from the original to the new one, the bitmap fill succeeds.

What I’m inferring is, the beginBitmapFill() function seems to fail in this certain situation, where the same Bitmap data is being drawn more than once in a relatively short period of time.

I suspect that this has something to do with endFill(). The AS3 language reference states that a bitmap fill isn’t drawn to the screen before the endFill() method is called, and even though I am calling it, I think that this strange endFill() dependency may be causing the problem.

Has anyone else experienced a similar problem with a bitmap fill failing to draw to the screen?