# \[FMX\] Loading External Data, this is keeping me up at night

**URL:** https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512
**Category:** Uncategorized
**Created:** [April 6, 2004, 4:04pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512 "2004-04-06T16:04:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)
#### Post date: [April 6, 2004, 4:04pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/1 "2004-04-06T16:04:43Z")

</div>

Hi,

In the following example can you explain why loading the text with button event handler is treated like HTML.

[http://www.kirupa.com/developer/mx/externaldata.htm](http://www.kirupa.com/developer/mx/externaldata.htm)

[http://www.kirupa.com/developer/mx/multiple\_dynamictext.htm](http://www.kirupa.com/developer/mx/multiple_dynamictext.htm)

And in the latter tutorial the text is treated like a variable, which I understand. Is it possilbe to alter the fomer tutorial to load the data as a variable and not HTML?

```
                            *
```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 4:18pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/2 "2004-04-06T16:18:25Z")

</div>

I dont understand, those tutorials use the same method.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 4:35pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/3 "2004-04-06T16:35:01Z")

</div>

Hi,

Thanks for your prompt relpy. In the tutorial written by Kirupa he loads the text as a variable.

loadText = new loadVars();  
loadText.load(“data.txt”);  
loadText.onLoad = function() {  
name.text = this.name;  
email.text = this.email;  
location.text = this.location;  
};  
In this example the data is loaded as HTML, but does not contain HTML formatting.  
on (release) {  
loadText = new loadVars();  
loadText.load(“TEXT1.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
newsBox.html = true;  
newsBox.htmlText = this.myNews;  
}  
};  
}

I’m just wondering if this the best practice for using the data with button events, or is there a method to use kiupa’s method with the button events?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 4:45pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/4 "2004-04-06T16:45:01Z")

</div>

You can use:

```auto
on (release) {loadText = new loadVars();
loadText.load("data.txt");
loadText.onLoad = function() {
name.text = this.name;
email.text = this.email;
location.text = this.location;
};
};

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 4:59pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/5 "2004-04-06T16:59:31Z")

</div>

> [@claudio](#):
>
> You can use:
> 
> ```auto
> on (release) {loadText = new loadVars();
> loadText.load("data.txt");
> loadText.onLoad = function() {
> name.text = this.name;
> email.text = this.email;
> location.text = this.location;
> };
> };
> 
> ```

Thanks again,  
I was wondering how to modify the second code example to omit the HTML formatting call. However if this is the best code to use, I’ll simply get some sleep.  
on (release) {  
loadText = new loadVars();  
loadText.load(“TEXT1.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
// trace(success);  
newsBox.html = true;  
newsBox.htmlText = this.myNews;  
}  
};  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 6, 2004, 5:03pm UTC](https://forum.kirupa.com/t/fmx-loading-external-data-this-is-keeping-me-up-at-night/106512/6 "2004-04-06T17:03:10Z")

</div>

> [@cki](#):
>
> Thanks again,  
> I was wondering how to modify the second code example to omit the HTML formatting call. However if this is the best code to use, I’ll simply get some sleep.  
> on (release) {  
> loadText = new loadVars();  
> loadText.load(“TEXT1.txt”);  
> loadText.onLoad = function(success) {  
> if (success) {  
> // trace(success);  
> newsBox.html = true;  
> newsBox.htmlText = this.myNews;  
> }  
> };  
> }

Forget about the [font=Courier New]textfield.html[/font] property and use the [font=Courier New]textfield.text[/font] property to assign the variable in the textfile to the textfield:

```auto
newsBox.text = this.myNews;

```
