I would personally do this with MovieClipLoader. Using a timer to assume the load duration is very dangerous as it creates a race condition which users with very slow connections will fail.
This is a simple example using MovieClipLoader and Delegate to keep the scope of the event function local to the rest of your code, just like addEventListener does in AS3. First, the SWF to be loaded, which I have called 'child.swf'. This contains an animation and on frame 1 it defines a string variable called 'hello':
var hello:String = "Hi";
In the parent SWF we will have the loader code, and a library item with an identifier of 'mc1', which will be attached to the stage above the loaded SWF.
//grab Delegate to mimic AS3 event handler scope
import mx.utils.Delegate;
//create container for the loaded SWF
var loadedMC:MovieClip = createEmptyMovieClip("loadedMC",5);
//create the loader (don't cast it though, or you can't directly access the events)
var loader = new MovieClipLoader();
//set up a listener for the load init (called when the first frame of the loaded MC is executed)
loader.onLoadInit = Delegate.create(this, onMovieInit);
//start loading
loader.loadClip("child.swf",loadedMC);
//init handler
function onMovieInit()
{
//create the next layer from the library
var firstMC:MovieClip = attachMovie("mc1","newName",10);
//trace var from loaded mc
trace(loadedMC.hello); // hi
}
MovieClipLoader calls the onLoadInit function when the target SWF is loaded and the first frame has been processed, meaning that any code on the first frame is now available to the parent SWF. Delegating the call to onLoadInit rather than using a listener object as the official documentation would like you to removes the requirement to use _root within the handler function because the scope of the function has not changed.