views:

239

answers:

1

In my AS3/Flash Player 10 app, I've got a movieclip on the stage with its own transform.perspectiveProjection properties configured; in particular, I'm explicitly setting its projectionCenter so that it has its own vanishing point (see this question for details). I'm adding functionality to my application so that if a user clicks one of the buttons around the transformed movieclip, a lightbox-style layer appears over the 3D-transformed movieclip.

The problem I'm having is that when the lightbox layer appears, there's a perceptible shift in the location/transformation of the transformed movieclip, and when the lightbox layer is removed, the transformed movieclip returns to its original location. Stranger still, this effect only happens about half the time; usually, the first couple of lightbox invocations have no effect, but the third or fourth causes the 3D movieclip to jump around.

There's no 3D elements that are part of the lighbox (i.e. no z-indices are being explicitly set), and I can't find documentation of this phenomenon anywhere else. Is this a bug in FP 10? If it is, the only workaround I can think of is taking a snapshot of the 3D-transformed movieclip as bitmapData and showing that in place of the 3D mc whenever the lightbox appears, but that seems inefficient and brutally hackish. Any thoughts?

+3  A: 

Here's a guess - could the added contents be situated in the display hierarchy so that they wind up in the same Bitmap Cache as your 3D contents? As you probably know, Flash implements all bitmap effects by internally drawing the object into a bitmap, and then doing a filter on the bitmap, and this includes 3D perspective distortion. My guess is, when you add contents into the display object, the bounds of the area being rasterized change, and it's causing a change in how your 3D object gets pixelated. Again, this is a guess, but you might play with it and see if this is the culprit.

fenomas
Spot on! I never would have guessed that's what was going on, but as it happens, for masking reasons I'd been caching most of the application as a bitmap. I turned off the caching as soon as it was no longer needed and the bizarre behavior vanished. Many thanks!
justinbach
Hehe, for once intuition pays off. Glad it worked!
fenomas