i have now done follows in screen.as:
before constructor:
private var _otherHasToResize:Boolean = false;
private var firstCreate:Boolean = true;
then the changed resize()-function…
public function resize():void
{
if (_bitmap[1 - _current]) {
_sprite.removeChild(_bitmap[ 1 - _current]);
_bitmap[1 - _current].bitmapData.dispose();
}
// create screen buffers
if (firstCreate) {
_bitmap[0] = new Bitmap(new BitmapData(FP.width, FP.height, false, _color), PixelSnapping.NEVER);
_bitmap[1] = new Bitmap(new BitmapData(FP.width, FP.height, false, _color), PixelSnapping.NEVER);
firstCreate = false;
} else {
_bitmap[1 - _current] = new Bitmap(new BitmapData(FP.width, FP.height, false, _color), PixelSnapping.NEVER);
}
_sprite.addChild(_bitmap[_current]).visible = true;
_sprite.addChild(_bitmap[1 - _current]).visible = false;
FP.buffer = _bitmap[_current].bitmapData;
_width = FP.width;
_height = FP.height;
_current = 0;
}
you see… after firstcreate of the bitmap-buffers, only the not visible buffer is setted in this function…
changed swap()-function does the rest…
public function swap():void
{
_current = 1 - _current;
FP.buffer = _bitmap[_current].bitmapData;
if (_otherHasToResize) {
otherResize();
_otherHasToResize = false;
}
}
and calls otherResize()
private function otherResize():void {
if (_bitmap[1 - _current]) {
_sprite.removeChild(_bitmap[1 - _current]);
_bitmap[1 - _current].bitmapData.dispose();
}
_bitmap[1 - _current] = new Bitmap(new BitmapData(FP.width, FP.height, false, _color), PixelSnapping.NEVER);
_sprite.addChild(_bitmap[1 - _current]).visible = false;
}
but… damn… resizing ends further in flickering!!!
either i made a mistake in the codes above… or it is not the problem!!