TypeError: Error #1010: A term is undefined and has no properties

Hi i am currently designing a site an i am having a strage issue with the code. The way the site works is on the main SWF is an empty movieclip and all content is loaded into that, now i have designed some code to control the events, as it stands the program loads up the main section into the swf, then the code controls the buttons on that main SWf and looks for when they are clicked, if they are clicked it will execute another function and load that section up, at the moment i have only created 3 section as i have run into a coding error. When the main code is loaded it runs fine but as soon as i click on the “swf.paper2.websiteBttn” button i get this error:

[AS]TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-5()[/AS]

and the Web section doesnt load up 1st time always sometimes it take 2 or 3 clicks until it loads and with each click i get that error. However i have tried to see if it is just the SWF section wthat is causing it by loading different SWF files in but the same error occurs, i dont understand where “MethodInfo-5()” is to solve the proble, my code is below and i hope someone can help??! thanks

[AS]homeBttn.addEventListener(MouseEvent.CLICK, loadWeb);

function loadWeb(evt:MouseEvent):void {
var pageLoader:Loader = new Loader();
var pageURLReq:URLRequest = new URLRequest ( “pages/AS3 Portfolio Main.swf”);
var swf:MovieClip;
pageLoader.load(pageURLReq);
pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);

function imageLoaded(evt:Event):void {
    holder.addChildAt(pageLoader.content, 1 );
    holder.removeChildAt(2);
    swf = evt.target.content;
    
    var button:MovieClip = swf.paper2.websiteBttn;
    button.addEventListener(MouseEvent.CLICK, openWeb);
    
}
function openWeb(e:Event):void {
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Web.swf");
    var swf:MovieClip;        
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
    
            
    function imageLoaded(evt:Event):void {
        trace("Content Loaded");
        holder.addChildAt(pageLoader.content, 1 );
        //trace("Content Loaded 2");
        holder.removeChildAt(2);
        //trace("Content Loaded 3");
        swf = evt.target.content;
    
    var button:MovieClip = swf.web2.pacBttn;
    button.addEventListener(MouseEvent.CLICK, openPac);
    
    }
    function openPac(evt:MouseEvent):void {
    var pageLoader:Loader = new Loader();
    var pageURLReq:URLRequest = new URLRequest ( "pages/AS3 Portfolio Pac Images.swf");
    var swf:MovieClip;        
    pageLoader.load(pageURLReq);
    pageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
            
    function imageLoaded(evt:Event):void {
        holder.addChildAt(pageLoader.content, 1 );
        holder.removeChildAt(2);
    }
}

}
}

[/AS]