# External Preloader Error #1009

**URL:** <https://forum.kirupa.com/t/external-preloader-error-1009/290165>\
**Category:** flash\
**Created:** [June 10, 2009, 5:54pm UTC](https://forum.kirupa.com/t/external-preloader-error-1009/290165 "2009-06-10T17:54:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [June 10, 2009, 5:54pm UTC](https://forum.kirupa.com/t/external-preloader-error-1009/290165/1 "2009-06-10T17:54:01Z")

</div>

I used an external preloader to call a swf is totally calling all the objects and functions through class, and there is nothing on the stage and timeframe.

It shows **TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at main()**

Isit because i must put something on the stage or timeline for it to load??

```auto

var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("main.swf"));

function loop(e:ProgressEvent):void
{
    var perc:Number = e.bytesLoaded / e.bytesTotal;
    percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
    removeChildAt(0);
    percent = null;
    addChild(l);
}

```
