Control Loading and Unloading External SWFs

Hi,

I’m trying to load and unload a swf into my main stage however im trying to fade in and fade out the swf previously i had this in as2 which on pressing a button loaded the swf into a container(mc) using the following code

on (release) 
{
   if (_root.currMovie == undefined) 
   {
      _root.currMovie = "Company";
      _parent.container.loadMovie("Company.swf");
   } 
   
   else if (_root.currMovie != "Company")
   {
      if (_parent.container._currentframe >= _parent.container.midframe) 
      {
         _root.currMovie = "Company";
         _parent.container.play();
      }
   }
}

this loaded the swf, within the swf itself it had a fade in until x frame which then stopped. then on pressing another menu button it would fade the current swf out by playing on from frame x and unload it then load the appropriate swf. the code within the swf is below

on first frame


midframe=25

on last frame


_root.container.loadMovie(_root.currMovie+".swf")

im trying convert this code into as3 any help would be gratefull

also find the original tutorial at http://www.kirupa.com/developer/mx2004/transitions.htm

Thanks