# Loading external text with button. Error #1009

**URL:** <https://forum.kirupa.com/t/loading-external-text-with-button-error-1009/293382>\
**Category:** flash\
**Created:** [July 28, 2009, 8:20am UTC](https://forum.kirupa.com/t/loading-external-text-with-button-error-1009/293382 "2009-07-28T08:20:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![acharlesmobile](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@acharlesmobile](https://forum.kirupa.com/u/acharlesmobile)\
**Post date:** [July 28, 2009, 8:20am UTC](https://forum.kirupa.com/t/loading-external-text-with-button-error-1009/293382/1 "2009-07-28T08:20:46Z")

</div>

Hi everyone, I am designing a website in flash now and I’ve run into a snag as I am a noob.

I have a button (LOW\_btn), located in one movieclip, and is set to play the next frame of another movie clip “bodybox\_mc” and at the same time load an external .txt file into a dynamic text box “musictext\_txt”, which is deeper within the “bodybox\_mc”. (There is an update to “musictext\_txt”'s scrollbar as well). However at runtime i receive the error 1009 (output is after the code).

Here is the code (sorry if the variables and stuff are a bit long):

```auto
function loadLOW(event:MouseEvent):void
{
    MovieClip(this.root).bodybox_mc.gotoAndPlay(2);

    var myMusicLOWTextLoader:URLLoader = new URLLoader();
    myMusicLOWTextLoader.load(new URLRequest("musicLOWtext.txt"));
    myMusicLOWTextLoader.addEventListener(Event.COMPLETE, LOWLoaded);
    function LOWLoaded(e:Event)
    {
        MovieClip(this.root).bodybox_mc.bodyboxbox_mc.musictext_txt.htmlText = e.target.data
        MovieClip(this.root).bodybox_mc.bodyboxbox_mc.sb.update();
    }
}
menuboxbox_mc.LOW_btn.addEventListener(MouseEvent.CLICK, loadLOW);

```

With debugging permitted, the output is this:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at music2EXPERIMENT\_fla:menubox\_2/loadLOW/music2EXPERIMENT\_fla:LOWLoaded()[music2EXPERIMENT\_fla.menubox\_2::frame1:9]  
at flash.events::EventDispatcher/dispatchEventFunction()  
at flash.events::EventDispatcher/dispatchEvent()  
at [flash.net](http://flash.net)::URLLoader/onComplete()

So the problem seems to be on the line with

```auto
"MovieClip(this.root).bodybox_mc.bodyboxbox_mc.musictext_txt.htmlText = e.target.data"

```

As in probably the “e.target.data” part. What does this mean and how can i fix this?

Thank you so much for your time.
