A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How do I know if unloadandstop has worked?

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    33

    Question How do I know if unloadandstop has worked?

    Well, the subject says it all really.

    I want to unload a swf and have it removed from memory, I use 'unloadAndStop'. But how can I check if the swf / MC has really been removed?

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    Grant skinner touched on this a while back. Basically , as long as you don't have an internal references to your loaded content , or anything inside of it , it should be removed and marked for garbage collection. When I unload dynamic objects , I will often do a preshutdown on them , to remove any internal listeners , references , etc, before I remove it completely. This usually prevents any memory leakage later. You can install , http://doudehou.googlepages.com/StatusbarEx , if you use firefox on windows , which will allow you to monitor how much memory the browser is using , and i suppose take note of the value with the swf loaded and unloaded , it should be smaller when unloaded. Assuming that the value of added memory usage when loaded is significant enough to notice. Outside of that , just checking on_removed_from_stage , and numchildren on the container clip , or display list , and setting any reference to the object to null , is about all you can do. At leas that i know of.

  3. #3
    Senior Member
    Join Date
    Jan 2009
    Posts
    208
    you shouldnt rely on this and should clean after yourself.
    so remove listeners, stop timers, remove children, set to null and so on...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center