Hi,
how to clear bmp/sprites of the memory?
I use this function to generate sprites of the lib:
PHP Code:
addSprite(j * tilesDim, i * tilesDim, "spr_" + root["tile_" + map][i][j], mcTile);
function addSprite(X: int, Y: int, c: String, mc: Object) {
cls = getDefinitionByName(c) as Class;
bmp = new cls(0, 0) as BitmapData;
sprite = new Bitmap(bmp);
mc.addChild(sprite);
sprite.x = X;
sprite.y = Y;
sprite.name = c;
}
I already tried this:
PHP Code:
bmp.dispose()
bmp = null
But it does not work, the memory continues to increase. Any idea?