views:

2416

answers:

2

Is it better to Unload a MovieClip before Removing it off the Stage, in order for its contents to get cleared from RAM and therefore free up RAM better?

Adobe Flash AS2 Documentation:

  • removeMovieClip() - Removes a movie clip instance.
  • unloadMovie() - Removes the contents of a movie clip instance.
A: 

A removeMovieClip does an explicit unloadMovieClip (if necessary). However, unloading a clip does not remove the instance.

Luke
If necessary? Whats the criteria. Is it better to Unload a MovieClip before Removing it off the Stage?
Jenko
I think Luke meant to say "implicit", or perhaps "automatic". The unloading is done automatically by removeMovieClip() if the MovieClip has any contents. If not, there's no need to unload it.
bzlm
+1  A: 

No. According to the Live Docs:

unloadMovieClip removes the contents of a movie clip instance. The instance properties and clip handlers remain.

To remove the instance, including its properties and clip handlers, use MovieClip.removeMovieClip().

This means removeMovieClip() will remove all traces of a MovieClip instance, while unloadMovieClip() will only remove the contents of it. It also means unloadMovie() is not necessary to call before calling removeMovieClip().

bzlm
Good. Thought as much.
Jenko