Calling user defined function

Hi,

First Off a disclaimer: I am sorry if there is a similar posting out there. I have tried searching for a solution and I guess I am too pooped out to even think of better keywords to find a solution.

Scenario:

I am trying to load external swf’s into my main swf through nested movieclips.
Its like this: STAGE > contents_mc > loader_mc
Also most of the code is from tutorial’s out on the net.

[COLOR=Blue]Content_mc[/COLOR]
I have the following MC’s in content_mc (on 2 separate layers, if you want to know):

  • Preloader_text (PText)
  • loader_mc (LoaderExt)

Actions on content_mc:


pText._visible = false;
[COLOR=DarkOrchid]**LoaderExt.ClipLoader("home.swf");**
[/COLOR]
function preLoadStart(): Void{[INDENT]pText._visible = true;
[/INDENT]}
    
function preLoadProgress(lBytes, tBytes){

    pText.text = "% "+Math.round((lBytes/tBytes)*100);
 }
 
function preLoadComplete(): Void {

    pText._visible = false;
 }

[COLOR=Blue]**
loader_mc **[/COLOR](name LoaderExt)

Nothing on the timeline yet

Actions of loader_mc:


var myMCL = new MovieClipLoader();//create an instance of MovieClipLoader

myMCL.onLoadStart = function (targetMC)
{        trace("------------START ON LOAD
");
        var loadProgress = myMCL.getProgress(targetMC);
        _parent.preLoadStart();
}
myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
        
        _parent.preLoadProgress(loadedBytes, totalBytes);

}
myMCL.onLoadComplete = function (targetMC)
{        
        trace("END ON LOAD-----------------");
        var loadProgress = myMCL.getProgress(targetMC);
        _parent.preLoadComplete();
}
myMCL.onLoadInit = function (targetMC)
{
        trace ("Movie clip:" + targetMC + " is now initialized");
        //targetMC._width = 605;
        //targetMC._height = 1048;

}
myMCL.onLoadError = function (targetMC, errorCode)
{
        trace ("ERRORCODE:" + errorCode);
        trace (targetMC + "Failed to load its content");
}

[COLOR=DarkOrchid]**function ClipLoader(ClipToLoad): Void{

    trace("IN LOAD CLIPS");
    myMCL.loadClip(ClipToLoad, this);
}**[/COLOR]

Problem:
I am having a problem in calling the function ClipLoader and loading a clip through the loader_mc MovieClip (the text in [COLOR=DarkOrchid]Purple[/COLOR]). The reason I am using this is eventually I will put in code in contents_mc to load various external swf per conditions i give.

Please please please help. I have a feeling it is a very simple thing that I am forgetting/skipping or I have totally messed up my MC setup…

Thanks in Advance!