title: unable to delete only the very first of a series of objects
body: <p>This is kind of long - don't know if anyone will bother to read it (don't know if I would), but been beating my head against this for over a day.</p>
  
  <p>I have a problem where the first of a series of objects I create is not ever being deallocated.  I'm removing event listeners from the object, using the localconnection hack, etc. and it works to immediately deallocate any object except the very first one.</p>
  
  <p>Here is the background:</p>
  
  <p>I originally had this application which was an mxml file consisting primarily of a huge mx:Script block of pure actionscript 3. The application was configured via an xml file, the name of which was passed into it from the html file at startup.  </p>
  
  <p>The change I made was to allow a new xml file to be subsequently loaded (and reconfigure the app), when a user clicked on a hyperlink to an xml file.  To facilitate this,  I took that entire aforementioned block of code out of the mxml file and put it in its own class, in an .AS file.   Now the main mxml file is absurdly short -   all it does is instantiate this new class in the mxml application declaration:    </p>
  
  <pre><code>initialize="{new Rad_XF(this);}"  
  </code></pre>
  
  <p>This new Rad_XF object contains all the old code previously found in the mxml file. </p>
  
  <p>And now if a user clicks a link pointing to a valid xml file, the existing Rad_XF Object creates a new Rad_XF object, and the new Rad_XF object, after its initialized, deletes the old one. And this works to delete any previous Rad_XF object - except the very first one (the one intialized as above).  </p>
  
  <p>Here is the code in Rad_XF to create a new Rad_XF object if the user clicks a link:</p>
  
  <pre><code>private function txt_linkHandler(e:TextEvent):void  { 
    if (getExt(e.text).toUpperCase() == "XML")
      new Rad_XF(parent_app,this,e.text);  
    else 
      navigateToURL(new URLRequest(e.text),"_self");
  } 
  </code></pre>
  
  <p>And the code in Rad_XF to destroy the previous Rad_XF object:</p>
  
  <pre><code> if (rad_xf_prev) {
  
      parent_app.removeChild(rad_xf_prev.CanvasSB);   
  
      parent_app.removeEventListener("enterFrame",rad_xf_prev.app_enterframe);
      parent_app.removeEventListener("mouseFocusChange",rad_xf_prev.repeat_end);
      parent_app.removeEventListener("activate",rad_xf_prev.app_activate_handlr);
      parent_app.removeEventListener("deactivate",rad_xf_prev.app_activate_handlr);
      parent_app.removeEventListener("mouseMove",rad_xf_prev.mouse_handlr);
      parent_app.removeEventListener("click",rad_xf_prev.mouse_handlr);
      parent_app.removeEventListener("doubleClick",rad_xf_prev.mouse_handlr);
  
      rad_xf_prev = null;
  
      try { 
         new LocalConnection().connect('foo'); 
         new LocalConnection().connect('foo'); 
      } catch (e:*) {} 
  
    }
  </code></pre>
  
  <p>There is no difference at all, either intended or thus far discernable, between that first object and all subsequent objects, and yet the first object won't be deleted though subseqent ones will.  (I enclosed the above block in System.TotalMemory calls to confirm this.) The first object is initialized in the mxml file, but I tried moving that to an AS file - made no difference.  </p>
  
  <p>Here are the first few lines of the Rad_XF constructor:</p>
  
  <pre><code>public function Rad_XF(parent_app:Application, rad_xf_prev:Rad_XF=null, fnCFG:String = null):void {
  
    this.parent_app = parent_app;             
    this.rad_xf_prev = rad_xf_prev;
  </code></pre>
  
  <p>parent_app is the mxml application.  rad_xf_prev is the previous rad_xf object that ends up being deleted.</p>
  
  <p>Just didn't know if someone would bother to read this and have some viable ideas.  Or thought maybe the process of writing this might give me some additional ideas, but it didn't.</p>
  
  <p>(Note: Rad_XF does not extend any existing actionscript or flex class - should it?)</p>