# Adding preloader causing many errors

**URL:** <https://forum.kirupa.com/t/adding-preloader-causing-many-errors/269904>\
**Category:** flash\
**Created:** [September 2, 2008, 10:45pm UTC](https://forum.kirupa.com/t/adding-preloader-causing-many-errors/269904 "2008-09-02T22:45:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![madfatter](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@madfatter](https://forum.kirupa.com/u/madfatter)\
**Post date:** [September 2, 2008, 10:45pm UTC](https://forum.kirupa.com/t/adding-preloader-causing-many-errors/269904/1 "2008-09-02T22:45:08Z")

</div>

Hi,

I have a very elaborate flash project that works well when you load the .swf directly into the html page. However, once I added a prelaoder (using the show display progress code from “Essential ActionScript 3.0” example 28-8 which I’ve used successfully before) the .swf loads with a number of errors:

> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at Scrollbar()  
> at flash.display::Sprite/constructChildren()  
> at flash.display::Sprite()  
> at flash.display::MovieClip()  
> at international\_fla::MainTimeline()  
> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at Scrollbar()  
> at flash.display::Sprite/constructChildren()  
> at flash.display::Sprite()  
> at flash.display::MovieClip()  
> at international\_fla::MainTimeline()  
> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at international\_fla::MainTimeline/initializeFlyerScrollbar()  
> at international\_fla::MainTimeline/frame1()  
> http status: 0

There’s a lot of code in the file so I’m unsure what would be useful to post here. Does anyone know what would cause a preloading swf to cause a working swf to break like this?

The scrollbar that is referenced in the error code came from this site:

[http://flashrevolution.net/actionscript-3-scrollbar/](http://flashrevolution.net/actionscript-3-scrollbar/)

…and like I said, it works fine without the preloader. Could I possibly need to import anything into the preloader’s actionscript?

I’m happy to post anything that might be relevant. Thanks in advance for any advice.
