Hey all,
I have a two parter here for ya’s. I have a class that just adds a clip to stage with a few text fields and variables.
Is it better to remove that clip whenever it’s not visible or to just move it off stage?
And the second part, is there a way to monitor the performance of a movie? Such as ram, cpu, etc?
Thanks in advance ^^
About monitoring the performance:
In windows xp it used to be control + alt + del and then go to the performance tab, I don’t know in vista.
In mac os open activity monitor.

I was looking more for a system that would monitor flash and objects as they were added/removed… But thanks for the suggestion ^^
I know that if you remove the clip from the stage when it is not needed, it is not rendered. I think that if you move it out of view that it is still rendered, unless you set a mask somewhere, in which case the renderer performs ‘clipping.’
I would love a CPU process monitor for Flash that broke down what parts of the application were drawing what amount of CPU, it would be the most wonderfully awesome thing ever.
(Doesn’t exist though. :-/)
This won’t give a play by play - but you can use it to see if there are memory leaks - ie, if it keeps goin’ up - the garbage collector isn’t clearing certain items from memory:
ActionScript Code:
[LEFT][COLOR=#0000FF]import[/COLOR] flash.[COLOR=#0000FF]system[/COLOR].*;
[COLOR=#0000FF]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"Memory Used: "[/COLOR]+COLOR=#000000[/COLOR].[COLOR=#0000FF]toString[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];
[/LEFT]
As far as removing vs. hiding - personally, I prefer to removeChild IF I can assume that that object may sit hidden for as much time as it will be displayed. But, some things to consider:
• removing a child can throw error - if that child doesn’t exist - so if you are jumping frames or anything like that - something to watch for.
• make sure you remove any other references to your child. For example, if you add you child, then save a reference to within an array for example, you’ll want to clear both. That reference will stay in memory until the Garbage collector decides to clean it - or, depending on events - it may never get cleared from memory.
Thanks for the answers guys. It’s a ity something doesn’t exist to monitor flash more closely, but creatify’s tip will help some. Thanks again ^^
Hey hey all,
Been testing my scripts and I have a problem. I have a clip that I create on rollover and then remove on rollout. The clip itself doesn’t have any listeners on it. Its has a textfield with some text on it. The issue is that when I remove the clip it doesn’t release it’s memory, and rolling over will add it again, increasing the total memory usage. Now, I know the GC will remove it if it has no listeners or references and I went through and ensured that was the case.
Is there something else I may missing here? And just to test, tried creating it and just moving it way of stage and that works fine, but I’d rather free up the memory when the clip isn’t being viewed.
Look for RezMason’s ActiveGraph for memory monitoring… it’s an invaluable class 
Yeah, the GC will eventually get around to it, I don’t believe there is a way to dump this immediately - well, there may be, but Its not a one-liner worth of code.
Have you checked out Grant Skinner’s blog on GC and this? Really helpful/interesting stuff:
see here - then search for Garbage Collection.
Hope this helps.