Hello, Group-
Out of lurk mode, I have an AS3 kiosk I'm developing (as I learn to
migrate to AS3) and I'm having a problem with a Loader inside a loop
causing a bloating of RAM used at run time.
Here's what I'm doing, short and sweet:
var img = new Loader();
img.load(new URLRequest(MovieClip
(root).Global.matchmakerItems.taxPros.taxPro[z].image.text()));
catButton.proImage.addChild(img);
In operation, I have two drag-slide MCs. One populated with mc's for
category titles as text being drug horizontally, and when you release,
it snaps to one of the categories and triggers another drag-slide MC
to populate dynamically from XML data. Amongst that data is a series
of .jpg images loaded as a background.
You can then drag the vertical slider to select a sub-category, or
drag the horizontal slider to select another category which fades out
the vertical slider, empties the contents and runs the loop again to
re-populate.
The problem is, every time the loop runs, my resource monitor shows a
creep of about 12-15mb in the size of RAM used by the kiosk (deployed
as a Projector exe).
If I remove the above loader, the problem doesn't show up. Each loop
is roughly 10-12 images at 150kb each.
I've tried clearing out the container MC with:
while (taxProContainer.numChildren > 0) {
taxProContainer.removeChildAt(0);
}
or setting the loader to null or clearing it out with img.unload(),
but the only thing that makes a difference is removing the loader and
losing the images. I've also tried a variety of
Since the container is an empty MC, should I create it on the fly and
destroy it each cycle?
I'm quite stumped by this at the moment and chasing other fires, so
any thoughts or input would be greatly appreciated.
Thank you,
Steve K
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders