# Dynamic text cache

**URL:** <https://forum.kirupa.com/t/dynamic-text-cache/29766>\
**Category:** Uncategorized\
**Created:** [August 30, 2003, 4:15pm UTC](https://forum.kirupa.com/t/dynamic-text-cache/29766 "2003-08-30T16:15:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoppedup](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@hoppedup](https://forum.kirupa.com/u/hoppedup)\
**Post date:** [August 30, 2003, 4:15pm UTC](https://forum.kirupa.com/t/dynamic-text-cache/29766/1 "2003-08-30T16:15:48Z")

</div>

ok so i have 4 dynamic text fields in data.txt. imagine that they are…

menu1=blah…  
&menu2=blah…  
&facts=blah…  
&otherinfo=blah…

say in frame 5 i want to load the two menu items. so i execute the code  
[AS]loadText = new loadVars();  
loadText.load(“data.txt”);  
loadText.onLoad = function() {  
menu1.text = this.menu1;  
menu2.text = this.menu2;  
};[/AS]

now in frame 10 i want to load the other two fields. isnt the text file in memory, so is there a way to load those fields without opening the text field again? a way to do it other than:  
[AS]  
loadText = new loadVars();  
loadText.load(“data.txt”);  
loadText.onLoad = function() {  
facts.text = this.facts;  
otherinfo.text = this.otherinfo;  
};[/AS]

thanks

---

<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:** [August 30, 2003, 4:32pm UTC](https://forum.kirupa.com/t/dynamic-text-cache/29766/2 "2003-08-30T16:32:20Z")

</div>

Yes, you’d only need this code in frame 10:  
[AS]facts.text = loadText.facts;  
otherinfo.text = loadText.otherinfo;[/AS]

---

<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:** [August 30, 2003, 6:43pm UTC](https://forum.kirupa.com/t/dynamic-text-cache/29766/3 "2003-08-30T18:43:41Z")

</div>

oh ok… i kept trying to insert the whole function into frame 10:  
[AS]  
loadText.onLoad = function() {  
facts.text = this.facts;  
otherinfo.text = this.otherinfo;  
};  
[/AS]

silly me

thanks kode

---

<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:** [August 30, 2003, 6:45pm UTC](https://forum.kirupa.com/t/dynamic-text-cache/29766/4 "2003-08-30T18:45:22Z")

</div>

Hehe - You’re welcome. :beam:
