# \#2025 Error when loading a text field

**URL:** <https://forum.kirupa.com/t/2025-error-when-loading-a-text-field/258219>\
**Category:** flash\
**Created:** [April 22, 2008, 6:28am UTC](https://forum.kirupa.com/t/2025-error-when-loading-a-text-field/258219 "2008-04-22T06:28:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GriffinetSabine](https://avatars.discourse-cdn.com/v4/letter/g/a4c791/32.png) [@GriffinetSabine](https://forum.kirupa.com/u/GriffinetSabine)\
**Post date:** [April 22, 2008, 6:28am UTC](https://forum.kirupa.com/t/2025-error-when-loading-a-text-field/258219/1 "2008-04-22T06:28:32Z")

</div>

Hi everyone!

If you saw my last posts, I was having trouble unloading an externally loaded swf. Everything is peachy now on that score, so I’m all aflutter.

However! I have a new problem which I’m hoping you can help me with. In the same project, my externally loaded swf is a little window that can be dragged around. Within that window is a text box and five buttons. Each button loads the text box with new information via a URLLoader. Here is the code for the URLLoader:

var myURLLoader:URLLoader = new URLLoader();

myURLLoader.load(new URLRequest(“bio.html”));  
myURLLoader.addEventListener(Event.COMPLETE, dataLoaded);  
function dataLoaded(e:Event): void {  
myTfield.htmlText= myURLLoader.data;  
myTfield.scrollV = 1;  
}

Okay. Now, let’s look at two buttons:

main\_btn.addEventListener(MouseEvent.CLICK, albumText);  
function albumText(e:MouseEvent): void {  
myURLLoader.load(new URLRequest(“bio.html”));  
}

anth\_btn.addEventListener(MouseEvent.CLICK, lyricsText);  
function lyricsText(e:MouseEvent): void {  
myURLLoader.load(new URLRequest(“anth.html”));  
}

Everything looks fine, right? And the mechanism works at runtime, BUT, there is an annoying glitch that for the life of me I cannot fathom. Sometimes, and usually after I drag the clip around a bit, I get this error:

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.  
at flash.text::TextField/set htmlText()  
at bio\_fla::MainTimeline/dataLoaded()  
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction  
()  
at flash.events::EventDispatcher/dispatchEvent()  
at [flash.net](http://flash.net)::URLLoader/flash.net:URLLoader::onComplete()

Can anyone help me figure out why I’m getting this crazy error? What supplied DisplayObject is the Flash Player saying is not a child of the caller??

Thanks. I’ve attached the files for your parusal.
