# \[MX2004\] How to call dynamic input text from class

**URL:** <https://forum.kirupa.com/t/mx2004-how-to-call-dynamic-input-text-from-class/191684>\
**Category:** flash\
**Created:** [June 22, 2006, 9:00am UTC](https://forum.kirupa.com/t/mx2004-how-to-call-dynamic-input-text-from-class/191684 "2006-06-22T09:00:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joost\_Pastoor](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@Joost\_Pastoor](https://forum.kirupa.com/u/Joost_Pastoor)\
**Post date:** [June 22, 2006, 9:00am UTC](https://forum.kirupa.com/t/mx2004-how-to-call-dynamic-input-text-from-class/191684/1 "2006-06-22T09:00:56Z")

</div>

Hello all,

I have a problem with my actionscript, and i hope some of you can give me a push in the right direction.

In the GameBox class, I make several instances of the Movieclip/Class “Module”. These Module movieclips have a dynamic input text named “moduleNaam”.

The way how i make instances of Module:

```auto
class GameBox extends MovieClip
{
 ...
    
    function GameBox() {
        ....
        
        // Place the modules
        attachMovie("Module", 'Module1, 2001, {id: 1, naam: "icom4"});
        attachMovie("Module", 'Module2', 2002, {id: 2, naam: "ibk2"});
        attachMovie("Module", 'Module3', 2003, {id: 3, naam: "icom4"});
        attachMovie("Module", 'Module4', 2004, {id: 4, naam: "ibk2"});
....

```

Is this the right way to do such things?

Then, in the Module.as class

```auto
class Module extends MovieClip {
    ...
    var id : Number; 
    var naam : String; 
    
    function Module() {
        ....
        _root.gameBoxInst.Module1.moduleNaam.text = naam;
    }

```

But to call the moduleNaam via \_root is not very convenient, and how can I target this very module, ipv only Module1? Like: this or “Module”+id or something?
