Scaleform flash.filters causes swf images and shapes to not display when alt-tabbing back into game

I’ve just started using a lot of flash.filters (such as DropShadowFilter and BlurFilter) in my UI.

Looks great, but I’ve noticed that while in game, if I alt-tab out of the game, and then alt-tab back in, images and shapes that are using the dropshadow no longer show at all.

Moving the player around causes them to pop back in. However if I just sit still and give no input they remain invisible.

Has anyone else experienced this? I would be a massive shame if I couldn’t use these awesome libraries because of this small glitch.

Effects Drop Shadow, Outer Glow, and others, need to be in raster graphics. Text elements keep in vector graphics.

Adobe Flash menu bar Modify\Convert to Bitmap.

@GGBotnet Thanks for the response. Do you know if there is much overhead in converting display objects to bitmap?

When I attempt to convert an image into a Bitmap via AS3, using this method:



public static function ConvertDisplayObjToBitmap(displayObj:DisplayObject):Bitmap
{
    var bitmapData:BitmapData = new BitmapData(displayObj.width, displayObj.height);
    bitmapData.draw(displayObj);

    var bitmap:Bitmap = new Bitmap(bitmapData, "auto", /*smooth*/true);
    return bitmap;
}


The scaleform media player spits out this error:


Warning: The method BitmapData::draw() is not implemented

I’m guessing scaleform doesn’t support this…?

I’ve just implemented a REALLY nasty hack that appears to address the issue:

I render an invisible square at the top left of the movie, and move back and forth by 1px every second. Each time it moves it restores any invisible display objects that are using drop-shadow filters.

I’m unsure at this point what overhead this comes with (if any). Either way, it at least allows me to use flash.filter fx in my game.

I’d welcome any insight into better solutions or reasons why this is occuring in the first place. It could be isolated to the Scaleform wrapper that the game engine is using.

One solution is convert to Bitmap in Adobe Flash without script, and check in UDK console command “stat gfx”.

@GGBotnet Unfortunately doing it manually in the Flash editor won’t work for me as I have hundreds of items images that I sometimes want to use without drop-shadows.