AS3 calls method twice?

Hi,

I’m having an odd issue with some of my code for a flash website.

The code on my contact us page is


MovieClip(root).program.textContent(thisPageText0,0);
MovieClip(root).program.textContent(thisPageText1,1);
MovieClip(root).program.textContent(thisPageText2,2);
MovieClip(root).program.textContent(thisPageText3,3);
MovieClip(root).program.textContent(thisPageText4,4);

try {
MovieClip(root).program.contactFormAction(contactForm, contactForm.clearButton, contactForm.submitButton, 2);
trace("ok");
}
catch (error:Error) {
    trace("not ok");
}

and for some reason when I test it the ok appears twice.
This is the only place in the whole site where I use trace(“ok”); and it dosen’t appear at all in the contactFormAction() function so why does it show up in my output window twice?

The same page throws another error and I’m not sure if their related so I’ll put it here just in case.

I get the error

TypeError: Error #1010: A term is undefined and has no properties.
at Main/textContent()
at website_fla::actiontextScroll3_94/frame1()

when I open the contact us page.
The issue is the actiontextScroll3 actually appears on a different page.
When I used the debugger it kept getting suck on these points


public function textContent(nameText:TextField, numText:Number) {
            **nameText.htmlText = websiteXML.pages.titlePage[linkPage].texts.pageText[numText].text();**
            nameText.addEventListener(TextEvent.LINK, textLinkClick );
            nameText.condenseWhite = true;
            nameText.autoSize = TextFieldAutoSize.LEFT;

        }


MovieClip(root).program.textContent(thisPageText0,0);
MovieClip(root).program.textContent(thisPageText1,1);
MovieClip(root).program.textContent(thisPageText2,2);
MovieClip(root).program.textContent(thisPageText3,3);
MovieClip(root).program.textContent(thisPageText4,4);
**MovieClip(root).program.textContent(thisPageText5,5);**
MovieClip(root).program.textContent(thisPageText6,6);

Now I do use the textContent() function on the contact us page and there are only 4 textFields, so why is it calling the code for the previous page?
The page does load and all the right words end up in the right place, I’m just curious as to WHY THE HELL DOES IT DO THAT???

Any help would be appreciated.