Note that there are some explanatory texts on larger screens.

plurals
  1. PO(Actionscript 2.0) Passing a MovieClip to an external script. How to clean up
    primarykey
    data
    text
    <p>I've created a class that contains all of the movie clips from the stage. These variables are referring to the instance's name on the stage. Everything seems fine as long as I keep all of my functionality in a single class. However, when I try to use another class to manage the properties of a movie clip, I run into resource clean up issues.</p> <pre><code>//File (MainScreen.as) import utils.Container; class MainScreen extends MovieClip { private var clip1:MovieClip; private var clip2:MovieClip; private var container:Container public function MainScreen() { container = new Container(clip1); } public function CleanUpMess() { container.CleanUpMess(); // &lt;-- This part seems fine //? &lt;-- Should I be calling other things here? } } </code></pre> <p>I believe it's related to the assignment shown below <strong>mClip = clip</strong> I want to pass this movie by reference to be used by the Container class but I believe the garbage collector is getting confused when there are two references to the same MovieClip. Is there a way I can give it a hit that this reference is no longer needed. </p> <pre><code>//File (Container.as) class utils.Container { private var mClip:MovieClip; public function Container(clip:MovieClip) { mClip = clip; } public function CleanUpMess() { mClip.removeMovieClip(); // &lt;--- Doesn't seem to work removeMovieClip(mClip); // &lt;--- Doesn't seem to work } } </code></pre> <p>I've found <strong>MovieClip.removeMovieClip()</strong> in the Actionscript 2.0 documentation, but I think I'm using it incorrectly, or that it doesn't apply to my situation.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload