# Text formatting problem

**URL:** https://forum.kirupa.com/t/text-formatting-problem/186904
**Category:** flash
**Created:** [April 25, 2006, 10:33am UTC](https://forum.kirupa.com/t/text-formatting-problem/186904 "2006-04-25T10:33:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Club](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Club](https://forum.kirupa.com/u/Club)
#### Post date: [April 25, 2006, 10:33am UTC](https://forum.kirupa.com/t/text-formatting-problem/186904/1 "2006-04-25T10:33:35Z")

</div>

I have a problem when loading an external .txt file. Flash turns this:

"CV Verificatie, keurmerk voor uw sollicitatie

Het Curriculum Vitae Keurmerk, maakt uw sollicitatie ijzersterk."

into this:

“CV%20Verificatie%2C%20keurmerk%20voor%20uw%20sollicitatie%0A%0A  
Het%20Curriculum%20Vitae%20Keurmerk%2C%20maakt%20uw%20sollicitatie%20ijzersterk”

The script:

var loadText:LoadVars = new LoadVars();  
loadText.load(“text/01\_overons\_01.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
txt\_load.text = loadText;  
} else {  
txt\_load.text = “error”;  
}  
}

Please help!

---

<div class="post-metadata">

### Author: ![Mirandir](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Mirandir](https://forum.kirupa.com/u/Mirandir)
#### Post date: [April 25, 2006, 10:55am UTC](https://forum.kirupa.com/t/text-formatting-problem/186904/2 "2006-04-25T10:55:55Z")

</div>

Hmm it seems like it have’nt removed all url-encodings as it should. try to run it through unescape() first.

BTW do you have a “loadText” variable on the same timeline? as there is no “this” before it in the onLoad event it could be taking such a variable’s content instead.

```auto

var loadText:LoadVars = new LoadVars();
loadText.load("text/01_overons_01.txt");
loadText.onLoad = function(success) {
   if (success) {
      txt_load.text = **unescape(this.loadText);**
   } else {
      txt_load.text = "error";
   }
}

```

/Mirandir

---

<div class="post-metadata">

### Author: ![Club](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Club](https://forum.kirupa.com/u/Club)
#### Post date: [April 25, 2006, 11:12am UTC](https://forum.kirupa.com/t/text-formatting-problem/186904/3 "2006-04-25T11:12:11Z")

</div>

It doens’t seem to work, but thanks for helping, now I know of this unescape() command. This is the only loadText variable on the timeline, I have all the text in the movieclip but I want to get it all external, so this is just the first frame I’m trying. Besides, the variable LoadText with a capital L (I think).

Don’t know what you mean with the “this” bit.

---

<div class="post-metadata">

### Author: ![Club](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@Club](https://forum.kirupa.com/u/Club)
#### Post date: [April 25, 2006, 11:33am UTC](https://forum.kirupa.com/t/text-formatting-problem/186904/4 "2006-04-25T11:33:00Z")

</div>

It works now, I changed the period to a comma.

```auto

var loadText:LoadVars = new LoadVars();
loadText.load("text/01_overons_01.txt");
loadText.onLoad = function(success) {
   if (success) {
      txt_load.text = **unescape(this,loadText);**
   } else {
      txt_load.text = "error";
   }
}

```

Thanks!

---

<div class="post-metadata">

### Author: ![Mirandir](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Mirandir](https://forum.kirupa.com/u/Mirandir)
#### Post date: [April 25, 2006, 12:29pm UTC](https://forum.kirupa.com/t/text-formatting-problem/186904/5 "2006-04-25T12:29:57Z")

</div>

Aaah now I see. you’re assigning the actual LoadVars object to the textfield. Well that explains everything. My reference to this was assuming that loadText was a variable loaded with the LoadVars object. So in that code you can actually remove the loadText reference completetly and go with just “this”.

/Mirandir
