# Dynamic external text as button caption?

**URL:** https://forum.kirupa.com/t/dynamic-external-text-as-button-caption/157874
**Category:** Uncategorized
**Created:** [August 4, 2005, 9:16pm UTC](https://forum.kirupa.com/t/dynamic-external-text-as-button-caption/157874 "2005-08-04T21:16:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![merkske](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@merkske](https://forum.kirupa.com/u/merkske)
#### Post date: [August 4, 2005, 9:16pm UTC](https://forum.kirupa.com/t/dynamic-external-text-as-button-caption/157874/1 "2005-08-04T21:16:43Z")

</div>

Hi fellas,

Thanks to some nice tutorials I got external text loaded in a dynamic text field.

Now I would like to have the caption of a button loaded from an external .txt file.

Here is how I tried it:

created a button called “button” (instance name).  
Inside this button I created a background.  
On a layer on top of that background I put a dynamic textfield called: “caption” (instance name)  
When trying to load text from an external txt file the trace told me: undefined.

my code looks something like:

[AS]  
loadText = new LoadVars();  
loadText.load(“example.txt”);  
loadText.onLoad = function() {  
\_root.button.caption.text = this.btntxt01  
trace(\_root.button.caption.text)  
}[/AS]

n.e. ideas?
