# Flash MX : loading external text problem

**URL:** <https://forum.kirupa.com/t/flash-mx-loading-external-text-problem/43076>\
**Category:** flash\
**Created:** [February 18, 2004, 4:56pm UTC](https://forum.kirupa.com/t/flash-mx-loading-external-text-problem/43076 "2004-02-18T16:56:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveyc](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@daveyc](https://forum.kirupa.com/u/daveyc)\
**Post date:** [February 18, 2004, 4:56pm UTC](https://forum.kirupa.com/t/flash-mx-loading-external-text-problem/43076/1 "2004-02-18T16:56:03Z")

</div>

Help…I’ve grabbed this code from the tutorials section and it works fine. I’m now trying to adapt it so that I can use it in a function. I’m calling the function from a deeply nested button and trying to load the text into a deeply nested textfield. I’ve located which part of the code is giving me trouble but am having trouble sorting it. Any help would be great.

function contentLoad (contentTitle, contentFile, contentId) {  
\_root.mc\_contentMain.mc\_bodyText.txt\_title.text = contentTitle;  
// text loading function below  
loadText = new LoadVars();  
loadText.load(contentFile);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
\_root.mc\_contentMain.mc\_bodyText.txt\_textContent.htmlText = this.contentId;  
\_root.mc\_contentMain.mc\_bodyText.txt\_textContent.scroll = 1;  
}

Basically line 8 is the troublesome one.

\_root.mc\_contentMain.mc\_bodyText.txt\_textContent.htmlText = this.contentId;

contentId is obviously the variable name at the start of my text file, but I don’t understand what the ‘this.’ relates to when accessing the text from the external text file. Surely it can’t be the path to the text file as in the original tutorial the code is attached to a button - and the text file sure as hell ain’t in the button…

If anyone can shed any light on this I’d be grateful.  
Cheers - D
