[dirGames-L] overlaying flash with qt
Thomas Higgins
thiggins at macromedia.com
Wed Sep 7 10:45:12 EDT 2005
Jörg,
> Thanks for making that clear...am I right that this is mainly
> for other xtra members? because having a dts sprite over a
> bitmap doesn't cause any flicker...?
I'm going to play some word games here and say no, you don't have it quite right. You need to look at it like this: flickering will occur whenever you have two elements (stage + DTS sprite, DTS sprite + DTS sprite, etc.) trying to draw into the same area at the same time. This is easily seen in cases where you have media that's regularly changing (like QT and Flash, or QT and 3D, or ...), but things are a bit different with bitmaps as you must then keep in mind some core facts about Director's rendering engine.
Each frame our player only renders "dirty pixel regions", meaning it only renders those areas that have changed since the last frame. So in the case of a static bitmap member it will be drawn on stage the first time it appears but unless you change that member, its image, the sprite or its properties, then that region on the stage (remember, the "stage" in this case doesn't include DTS media!!!) is not dirty and therefore will not be redrawn. Therefore you can see that in the case of a DTS sprite over a bitmap once you've cleared the _very_first_ frame of the bitmap sprite, you'll only have one item drawing into that region on stage with that item being the DTS sprite, so no flickering occurs.
I'm being careful to make this distinction as it may in fact be possible to have non-Xtra driven media that changes frame by frame (fields for example, QuickDraw shapes, or bitmaps that you modify using imaging Lingo each frame) that could induce flickering. Yes, you're mostly right in that it tends to be Xtra driven media that updates on its own (again, things like QT, Flash, 3D, etc.) but those are not the only ways to go about all this.
Is the distinction clear? It's really important to know about the player's drawing routines and that it only updates dirty pixels as that plays a bit part in whether you get flickering or not. Please also note that it is because of this same behavior (only drawing dirty pixels) that you'll sometimes have remnants of a DTS sprite on stage after that sprite has been destroyed, the player doesn't know that area is "dirty" because the DTS Xtra was drawing into it before so in the stage's view it hasn't changed. Setting the stageColor equal to itself dirties every pixel, causes and entire stage redraw and removes the leftover image of the DTS sprite. Simply calling updateStage() only triggers a dirty pixel redraw. ;)
Make sense? If not then let me know and we'll give it another go.
Cheers,
Tom Higgins - Technical Product Manager
Macromedia Director and the Shockwave Player
http://weblogs.macromedia.com/thiggins/
...
More information about the dirGames-L
mailing list