# Document Class Load Other Classes

**URL:** <https://forum.kirupa.com/t/document-class-load-other-classes/329874>\
**Category:** flash\
**Created:** [October 30, 2012, 12:09am UTC](https://forum.kirupa.com/t/document-class-load-other-classes/329874 "2012-10-30T00:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![molkman](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@molkman](https://forum.kirupa.com/u/molkman)\
**Post date:** [October 30, 2012, 12:09am UTC](https://forum.kirupa.com/t/document-class-load-other-classes/329874/1 "2012-10-30T00:09:26Z")

</div>

Hello,  
I have a Document Class and through this I add in several other classes like this:

```auto
package {
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;
    public class DocClass extends MovieClip {
        public static var class1:Class1 = new Class1 ;
        public static var class2:Class2 = new Class2 ;
        public static var class3:Class3 = new Class3 ;

and so on

```

Now I have the problem with a preloader, because obviously all those classes get exported to frame 1 and this makes the preloader not showing up at all. But also if I set them to export on frame 2, all those classes added are returning crazy errors and all.

How can I add in those classes so they don’t cause errors when exporting to frame two, but are still available to be adressed by other classes? What “var class1:Class1 = new Class1 ;” at a later moment would do, but would cause the variables not to be available for others.

I’m really puzzled by that. Hope someone can help.  
Thanks.
