# Document Class and Loading classes into this class

**URL:** <https://forum.kirupa.com/t/document-class-and-loading-classes-into-this-class/294853>\
**Category:** flash\
**Created:** [August 20, 2009, 10:16pm UTC](https://forum.kirupa.com/t/document-class-and-loading-classes-into-this-class/294853 "2009-08-20T22:16:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeancnicolas](https://avatars.discourse-cdn.com/v4/letter/j/7bcc69/32.png) [@jeancnicolas](https://forum.kirupa.com/u/jeancnicolas)\
**Post date:** [August 20, 2009, 10:16pm UTC](https://forum.kirupa.com/t/document-class-and-loading-classes-into-this-class/294853/1 "2009-08-20T22:16:46Z")

</div>

Hi there, im trying to move to AS3 …  
So I came across this code, where the fla has a document class of **Main.as**  
This loads in … Ok. But what I dont get inside this code, is that it manages to load in **Secondary.as** without a form of reference I am familiar with :::: it must be easy stuff, but look at this…(Main.as)

```auto
package
{
    import flash.display.MovieClip;
        
    public class Main extends MovieClip
    {
        private var ac:Secondary;
                
        public function main()
        {
        ac = newSecondary ();
        addChild(ac);
        }
    }
}

```

Seconday.as is as follows (it doesnt do anything)

```auto
package 
{
    import flash.display.MovieClip;
    
    public class Secondary extends MovieClip
    {
        public function Secondary()
        {
            addEventListener(Event.ADDED_TO_STAGE, initThis);
        }
        private function initThis (evt:Event)
        {
            test = new Sprite();
            this.addChild(test);
        }
    }
}

```

any explanations would be tip top…
