# \[AS3\] Displaying variables in textfields inside a movieclip

**URL:** <https://forum.kirupa.com/t/as3-displaying-variables-in-textfields-inside-a-movieclip/327154>\
**Category:** flash\
**Created:** [February 9, 2012, 3:09pm UTC](https://forum.kirupa.com/t/as3-displaying-variables-in-textfields-inside-a-movieclip/327154 "2012-02-09T15:09:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattAS3](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@MattAS3](https://forum.kirupa.com/u/MattAS3)\
**Post date:** [February 9, 2012, 3:09pm UTC](https://forum.kirupa.com/t/as3-displaying-variables-in-textfields-inside-a-movieclip/327154/1 "2012-02-09T15:09:55Z")

</div>

[COLOR=#000000][FONT=verdana]This issue is my constant pain, and has set my project back some time. I’m creating a message system for my game, it’s supposed to record events that happened during travel, 3 vars per message (topic, in game date, content)[/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]All the vars are in an external as file and a public class. The problem is they return blank in the mc’s textfields while displaying correctly on the main timeline textfields at the same time. [/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]This is the code sitting inside the mc that doesn’t work.[/FONT][/COLOR]

[COLOR=#000000][FONT=verdana]

```auto
import Variables;
var variables:Variables = new Variables();
function setMsgSlot (e:Event) {
        msg1Subj_txt.text = variables.msg1Topic;
        msg1Date_txt.text = variables.msg1Date;
        trace ("Message topic is: " + variables.msg1Topic);
}
setMsgSlot(null);

```

[/FONT][/COLOR]  
[COLOR=#000000][FONT=verdana]And simply putting

[/FONT][/COLOR]

```auto
msgTopic_txt.text = variables.msg1Topic;

```

[COLOR=#000000][FONT=verdana]  
on the main timeline, even in the same frame, works perfectly, and i can’t figure out why.

I wasn’t sure what parts of code to add, if anyone needs any more info/code i will post it asap. Appreciate all your help[/FONT][/COLOR]
