dls schrieb:
Might be counting angels on a pin head here, but:
if I set alot ( think hundreds) of _global variables such as:
_global.state1 = Wisconsin;
I assume they slow the performance of my player.
Is there a way to clear them after use?
(or more specifically, the ones I don't need -- I could figure out how
to specify that in the code....)
Oh my, this really is a matter in Flash... Since we have often
experienced variable's values not being cleared after use, we do the
following:
my_var = null; // This first step probably is useless, but ALWAYS use
DELETE!
delete my_var;
If the value contained within the variable is a movieclip, then make
sure that this mc has an "onUnload"-handler that does the above with all
variables and to avoid instances from floating in memory after having
deleted, unloaded and removed them, if possible don't use static values!
I have made the experience that static instances stay in memory after
there is no reference to them left, since I set them all to null and
then deleted them. Then, when I re-create an instance of such static
stuff, it isn't created anew, but Flash uses the old piece that rests in
memory.
Maybe it's just that I don't really, really understand the concept of
"static", but I know it can lead to unpredictable and hard-to-track errors.
Best regards,
Roman.
--
-------------------------------------------------------------------
gosub communications gmbh | fredersdorfer str. 10 | 10243 berlin
t [030] 29 66 88 81 | f [030] 29 66 88 84 | http://www.gosub.de
-------------------------------------------------------------------
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders