Accessing DynamicText from external class

Hi everyone,

I know this has been asked countless times, I had a look at a many posts concerning this subject, but it got me confused more than anything. For example, I have looked at Senocular’s Tip of the day, but i’m still not quite sure what code needs to go where.

Here’s my setup: I have a DynamicText object on the main timeline, which is instantiated as “txtContent”. Now, from an external class (let’s call it LanguageManager, stored in LanguageManager.as) i’m trying to get access to this object so i can pass some text (ex: txtContent.text = “some text”).

So, which code should i put in a separate class file, and which code do i need to put in the class LanguageManager? Also, do i need to do :

addChild(txtContent);

in the main timeline even if the object is already sitting on the stage?

Thanks in advance for any help!