I have a strange issue where Flash Player in Chrome is not updating unless the browser is resized. The app is an online design tool, written in Flex, and one of the features allows the user to upload an image and crop it. The image loads fine, and the crop action does not reload the image but uses Bitmap.copyPixels to create the cropped version.
When I test on localhost (though a local server not just straight from the file system) the issue does not happen. However on our QA server the image does not appear unless you resize the browser, when I suppose a screen refresh is forced.
I’ve tried all the usual suspects in AS3/Flex to force a redraw, updateAfterEvent, invalidateDisplayList, etc.
One hacky solution we came up with is to resize the browser by a pixel, but this is obviously not ideal and I’d prefer a solution to a work-around 🙂
thanks!
Here’s the Bitmap code for reference…
var cropData:BitmapData = new BitmapData( _crop.width, _crop.height );
var originalData:BitmapData = new BitmapData( _loader.width, _loader.height );
originalData.draw( _loader );
cropData.copyPixels( originalData, _crop, new Point() );
var crop:Bitmap = new Bitmap( cropData );
crop.smoothing = true;
this.addChild( crop );
if ( _width > 0 && _height > 0 )
{
crop.width = _width;
crop.height = _height;
}
The flash player was embedded with the wmode param set to ‘opaque’, with this setting there seems to be an occasional bug in flash player for Chrome in which closing a Flex mx:Panel component does not result in the screen being updated.
Removing the wmode parameter fixes the issue above but the bug remains.