Why does ghosting occur in shape tweens? Is this some kind of rendering bug? I seem to keep running into stuff like this
(sorry, first post had image that was not cropped properly by MSPaint and had tons of white space; I fixed it)
--Background (feel free to skip if TL;DR): My SkinnedButton class supports states for DEFAULT, ROLLOUT, ROLLOVER, PRESS, RELEASE, RELEASEOUTSIDE, TRACKOVER, TRACKOUT, DRAGOVER, DRAGOUT, DRAGDROP, plus all variations of SELECTED_* states in addition to a "selectedMask" and "focusMask" display objects that are automatically arranged, docked, and made visible to suit not only the button state, but also (at least in the case of "focusMask") taking into account the manor in which it entered a particular state (via keyboard, via mouse, via assignment, what the drag source origin was, exact origin clip, custom tracked drag source, whether a drag even began, was cancelled, etc.). It dispatches events for all of these states and has fallback chains for any that are missing, since they're all classified into simple states out, over, and down. For example, if no RELEASE state is defined (can be either property named "mc_release" or "release" label on "skin" MovieClip), then it will progressively fall back to ROLLOVER, ROLLOUT, and finally DEFAULT until one is defined. The bare minimum for a functional button is to define a clip for the default state.
So anyway, I wanted to animate my "release" state by having the button collapse and expand, and I discovered this odd ghosting behavior. This is just a simple reproduction of the problem with no special logic, just a shape tween on a clip with scale9Grid active. It appears as though Flash isn't re-rendering the bottom most shape as its exposed by the tweened shape on the layer above:ShapeTweenGhosting.fla - Google Drive
I suspect this is occurring because of the active scale9Grid, since the ghosting goes away when you turn it off, but then the button is all distorted. Turning on cacheAsBitmap exhibits the same behavior. Again, it's not a performance issue, it's just incorrectly rendering. I don't see any documentation stating shape-tween animations are not allowed in clips with scale9Grid applied. The shapes themselves appear to be rendering correctly based on the scale9Grid (i.e. without distortion), but the ghosting is a problem.
Here is an even more pronounced example with a large shrinking and expanding oval shape:
I posted a bug here: Bug#3767678 - Ghosting occurs in shape tweens in clips with scale9Grid active
Continued experimentation revealed it occurs on the y axis too, and depends on how much you scale the clip.
At 99%, 100%, and 101%, no ghosting is observed. At 110%, it occurs a little bit. At 120%, the ghosting is very pronounced. I suspect the problem is arising due to inaccurate calculations of the redraw regions, which may not be taking into account certain scaling factors, perhaps such as stroke widths; however, I reduced all stroke widths to zero (hairline), and the ghosting still occurred, so something is not quite right.