Access parent swf classes

Hey Everyone,

I’m trying to make a swf loader that has all the classes in the main loader swf, and have all the loaded swf’s reference the classes in the parent. I’m having some problems… This is what i have so far:

SwfLoader (swfloader.as --> document class)

package {

    import flash.display.*;
    import flash.events.*;
    import flash.system.*;
    import flash.net.URLRequest;
    import flash.events.MouseEvent;
    import com.testLoader;
    
    public class Document extends MovieClip {
        
        public function Document() {
            // Constructor
            btnTest.addEventListener(MouseEvent.CLICK, fireTest);
        }
        
        private function fireTest(evt) {
            var x:testLoader = new testLoader();
            var swfLoader:Loader = new Loader();
            var swfLoaderContext:LoaderContext = new LoaderContext();
            var swfToLoad:String = "test1.swf";
            
            swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
            swfLoaderContext.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
            swfLoader.load(new URLRequest(swfToLoad), swfLoaderContext);
            x.helloWorld();
        }
        
        private function loadComplete(evt:Event){
            var swfInfo:LoaderInfo = evt.target as LoaderInfo;
            mcLoadFrame.addChild(evt.target.content);
        }
        
        
    }
}

externalSwf (externalSwf.as – document class)

package {
    
    import flash.display.MovieClip;
    import flash.display.SimpleButton;
    import flash.events.MouseEvent;
    import flash.system.ApplicationDomain;
    import flash.events.*;
    
    public class externalMovie extends MovieClip {
    
        public function externalMovie() {
            // Constructor
            this.btnTest1.addEventListener(MouseEvent.CLICK, testFunction);
        }
        
        private function testFunction(evt:MouseEvent){
            trace("button clicked");
            
            var xy:testLoader = new testLoader();
            xy.greetings();
        }
    }

}

TestLoader.as (class file that i import in the main swf and would like to use in the external swf)

package com {
    
    public class testLoader {
                
        public function testLoader() {
            // Constructor
        }
        
        public function helloWorld() {
            trace("hello world");            
        }
        
        public function greetings() {
            trace("hello world from inside a swf!");
        }
    }

}

According the flash liveDocs i should be able to reference my testLoader class in the external swf using a simple

var x:testLoader = new testLoader();

however whenever i do that, the compiler complains about

1046: Type was not found or was not a compile-time constant: testLoader

?

Any help would be greatly appreciated.
Thanks!
RaViD