# addChild() from \_NOT\_ document class

**URL:** <https://forum.kirupa.com/t/addchild-from--not--document-class/243426>\
**Category:** flash\
**Created:** [November 6, 2007, 10:22pm UTC](https://forum.kirupa.com/t/addchild-from--not--document-class/243426 "2007-11-06T22:22:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jao](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jao](https://forum.kirupa.com/u/Jao)\
**Post date:** [November 6, 2007, 10:22pm UTC](https://forum.kirupa.com/t/addchild-from--not--document-class/243426/1 "2007-11-06T22:22:27Z")

</div>

Hello everyone,

Recently started educating myself with AS3. And, of course, came to a dead end: I’ve found that addChild adds a sprite to the Stage when it’s called from Document Class. But what if i have my custom class, that i’m Importing to a stage with “import com.blabla.bla.x”; Then of course, I fire up my class and even passing a var to it for processing :

```auto
var l = (root.loaderInfo.parameters.lang == undefined) ? 'ee' : root.loaderInfo.parameters.lang;
var mm:x= new x(l);

```

all works ok, all traces out. But, can’t addChild from my .as file to the stage. Anyone knows where to dig?

Thanks,  
All the best.
