# Dynamic text field: swap text with diff variable in same ext. file

**URL:** <https://forum.kirupa.com/t/dynamic-text-field-swap-text-with-diff-variable-in-same-ext-file/120500>\
**Category:** Uncategorized\
**Created:** [August 25, 2004, 12:09am UTC](https://forum.kirupa.com/t/dynamic-text-field-swap-text-with-diff-variable-in-same-ext-file/120500 "2004-08-25T00:09:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [August 25, 2004, 12:09am UTC](https://forum.kirupa.com/t/dynamic-text-field-swap-text-with-diff-variable-in-same-ext-file/120500/1 "2004-08-25T00:09:14Z")

</div>

I’m using the recommended

```auto
loadText = new LoadVars();
loadText.load(_global.text_url2);
loadText.onLoad = function(success) {
    if(success){	}

etc..

```

which is working well. I just want to attach an action to buttons which will switch the text for different variables in the same text file, in a single text box named

```auto
archivetitle

```

.

ie.

```auto
archivetitle.text = this.title1;

```

when button one is pressed

```auto
archivetitle.text = this.title2;

```

when button two is pressed.

Basically, how do i access an already loaded text object to refresh to a new variable? Thanks!
