# Dynamic Text Issue

**URL:** https://forum.kirupa.com/t/dynamic-text-issue/298750
**Category:** Uncategorized
**Created:** [October 24, 2009, 1:13am UTC](https://forum.kirupa.com/t/dynamic-text-issue/298750 "2009-10-24T01:13:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Taxxem](https://avatars.discourse-cdn.com/v4/letter/t/c57346/32.png) [@Taxxem](https://forum.kirupa.com/u/Taxxem)
#### Post date: [October 24, 2009, 1:13am UTC](https://forum.kirupa.com/t/dynamic-text-issue/298750/1 "2009-10-24T01:13:54Z")

</div>

Hey all hope you can help me with this one… very strange.

I created a dynamic text from the tool bar and placed it on top of a rectangle that is a movieclip that points to class Information. I am giving you heads up because I did not create the dynamic text through var dytext:TextField…etc.

I named the instance p\_name. and in the constructor I did:

p\_name.text = “Empty”; this was sorta a warning that something isn’t  
working.

Then inside the document class named DocumentClass I created an instance of the parent class of p\_name called Information. basically I did.

var info:Information = new Information(); I did this to allow me to call a  
function inside the information class.

The Player class is where I draw the string to be placed into the dynamic text field.

info.UpdateInfo(player.player\_name); Update Info is simply passing in a  
string and changing p\_name inside the Information class.

I also changed the player.player\_name to something different.

player.player\_name = “New Name”; When I trace this it works fine 🙂

UpdateInfo function looks like this.

public function UpdateInfo(s:String)  
{  
p\_name.text = s;  
trace(p\_name.text);

}

When I trace p\_name it shows the correct string information, but it doesn’t update the text when I run the movie.

Am I doing something wrong? It seems strange because I would have thought it would update the dynamic text once it was changed but apparently not. I have noticed that the Information class does get created before my Document class. Im guessing this is because the objects are physically placed into the scene as opposed of being created dynamically.

I would greatly appreciate any help. I can give more code if needed but I didn’t want to spam the post.
