# addChild from .as file that isn't the document class

**URL:** <https://forum.kirupa.com/t/addchild-from-as-file-that-isnt-the-document-class/307785>\
**Category:** flash\
**Created:** [April 10, 2010, 7:17am UTC](https://forum.kirupa.com/t/addchild-from-as-file-that-isnt-the-document-class/307785 "2010-04-10T07:17:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [April 10, 2010, 7:17am UTC](https://forum.kirupa.com/t/addchild-from-as-file-that-isnt-the-document-class/307785/1 "2010-04-10T07:17:33Z")

</div>

Ok I’ve been searching for so long I can’t remember when I started. I’m quite new to AS3, but am very well versed in AS2. As such, I can’t do many simple things in AS3 that take 1 second to do in AS2, so I would appreciate any help.

All I want to do is attach a movieclip to the stage via a .as file that ISNT the document class.

So for examples sake lets say I have  
**Main.swf** - Main swf file with a movieclip called “PreloaderGUI”.  
**Main.as** - The document class, this loads Preloader.as.  
**Preloader.as** - This preloads the movie and attaches PreloaderGUI.

Can somebody please explain how to do this seemingly simple task? I have tried god knows how many different ways and I cannot for the life of me get ANY of them to work.

Thanks in advance to anybody who helps.

Brendan
