# Preloader for import

**URL:** <https://forum.kirupa.com/t/preloader-for-import/308160>\
**Category:** Uncategorized\
**Created:** [April 17, 2010, 9:42pm UTC](https://forum.kirupa.com/t/preloader-for-import/308160 "2010-04-17T21:42:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimicus](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dimicus](https://forum.kirupa.com/u/Dimicus)\
**Post date:** [April 17, 2010, 9:42pm UTC](https://forum.kirupa.com/t/preloader-for-import/308160/1 "2010-04-17T21:42:16Z")

</div>

Hi Guys.

i have a code that gives me error “#1009: Cannot access a property or method of a null object reference.”

I have a feeling i get this error because when i want to create a new variable the old variable hasent loaded yet, but i do not know how to check this.

My code look like this.

import treedbox;  
var treed:treedbox = new treedbox();  
addChild(treed);

Is there a way to put a preeloader on import treedbox and after its completed add the rest?

Why i think this is the case is because if i put the treedbox.as as a class under the document property and remove the code from the timeline it works fine.

treedbox is a 3d view that adds a cube if this make anything different.

Best regards  
Dimicus
