Quote:
stage.addEventListener(Event.ENTER_FRAME, kolla);
stage.addEventListener(MouseEvent.CLICK, add);
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
var objekt:Loader;
var bildArray:Array = new Array();
var bildIndex:uint = new uint();
function kolla(e:Event):void
{
trace(System.totalMemory);
}
function add(e:MouseEvent):void
{
objekt = new Loader();
bildArray[bildIndex] = objekt;
//objekt.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
objekt.load(new URLRequest("DubaiSTOR.jpg"));
bildIndex++;
}
function reportKeyDown(e:KeyboardEvent):void
{
if (bildIndex > 0) {
bildArray[bildIndex - 1].content.bitmapData.dispose();
bildArray[bildIndex - 1].unload();
bildArray[bildIndex - 1] = null;
bildIndex--;
}
trace(System.totalMemory + "SCHANSE");
try {
new LocalConnection().connect('foo');
new LocalConnection().connect('foo');
} catch (e:*) {}
}