# Load text

**URL:** <https://forum.kirupa.com/t/load-text/9461>\
**Category:** Uncategorized\
**Created:** [December 12, 2002, 9:11am UTC](https://forum.kirupa.com/t/load-text/9461 "2002-12-12T09:11:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![corinne](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@corinne](https://forum.kirupa.com/u/corinne)\
**Post date:** [December 12, 2002, 9:11am UTC](https://forum.kirupa.com/t/load-text/9461/1 "2002-12-12T09:11:05Z")

</div>

I want to load dynamically two text at the same time  
on the same frame. For that I wrotte :

loadText = new loadVars();  
loadText.load(“textes/news\_comp.txt”);  
loadText.onLoad = function() {  
newsscroller.html = true;  
newsscroller.htmlText = this.content;  
};  
loadText2 = new loadVars();  
loadText2.load(“textes/event.txt”);  
loadText2.onLoad = function() {  
eventscroller.html = true;  
eventscroller.htmlText = this.event;  
};

For some reason, offline every thing works fine but online only one text is loaded??  
Somebody now’s why?

Corinne

---

<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:** [December 12, 2002, 10:55am UTC](https://forum.kirupa.com/t/load-text/9461/2 "2002-12-12T10:55:48Z")

</div>

Did you try to change the order of the onLoad calls?

---

<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:** [December 12, 2002, 11:02am UTC](https://forum.kirupa.com/t/load-text/9461/3 "2002-12-12T11:02:49Z")

</div>

yes. The same problem.

---

<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:** [December 12, 2002, 10:56pm UTC](https://forum.kirupa.com/t/load-text/9461/4 "2002-12-12T22:56:09Z")

</div>

try adding the second load to the onload function of the first. I don’t know if Flash MX has separate threads of execution for each request you make. If it doesn’t, the first request keeps the single thread busy while your timeline thread simply zips right through the second request. Although it may be assumed that the second request simply is queued until the first is completed, this may not be the case–I don’t know! It all depends on how the Flash player is designed to handle the synching/queuing of threads. But I’ll bet if you instantiate the second request in the onload event handling method of the first, you’ll get the desired results. I’d bet something like this may work:

loadText = new loadVars();  
loadText.load(“textes/news\_comp.txt”);  
loadText.onLoad = firstLoaded;  
}

function firstLoaded() {  
newsscroller.html = true;  
newsscroller.htmlText = this.content;  
loadText2 = new loadVars();  
loadText2.load(“textes/event.txt”);  
loadText2.onLoad = secondLoaded;  
}

function secondLoaded(){  
eventscroller.html = true;  
eventscroller.htmlText = this.event;  
}

Hope that helps! I’m not lucky enough to have a Flash-related job (yet), so this is from memory/experience/theory–can’t test it out. Let me know if it works for you!  
-Brock

---

<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:** [December 12, 2002, 11:06pm UTC](https://forum.kirupa.com/t/load-text/9461/5 "2002-12-12T23:06:41Z")

</div>

I actually got it working this way:

```php
loadText = new loadVars();
loadText.load("content.txt");
loadText.load("event.txt");
loadText.onLoad = function() {
	newsscroller.html = true;
	eventscroller.html = true;	
    newsscroller.htmlText = this.content;
    eventscroller.htmlText = this.event;
};

```

---

<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:** [December 13, 2002, 9:12am UTC](https://forum.kirupa.com/t/load-text/9461/6 "2002-12-13T09:12:17Z")

</div>

its working.

[http://www.kemppro.com](http://www.kemppro.com)

Question: when you put on top “php:”,  
am I suppose do create php file ?

Thank’s for all your helps

Corinne

---

<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:** [December 13, 2002, 11:22am UTC](https://forum.kirupa.com/t/load-text/9461/7 "2002-12-13T11:22:32Z")

</div>

Nice menu! 😛

And no, you don’t have to create a PHP file, it’s just AS.

[SIZE=1]By the way, nice trick, h88. I’m rating this[/SIZE] 🙂

---

<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:** [December 13, 2002, 5:23pm UTC](https://forum.kirupa.com/t/load-text/9461/8 "2002-12-13T17:23:49Z")

</div>

Oh yeah, thanx for rating that ilyas, i rated it as well. 😉
