# Preloader pops TypeError: Error #1009:

**URL:** https://forum.kirupa.com/t/preloader-pops-typeerror-error-1009/321830
**Category:** flash
**Created:** [May 2, 2011, 9:19pm UTC](https://forum.kirupa.com/t/preloader-pops-typeerror-error-1009/321830 "2011-05-02T21:19:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![djburner](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@djburner](https://forum.kirupa.com/u/djburner)
#### Post date: [May 2, 2011, 9:19pm UTC](https://forum.kirupa.com/t/preloader-pops-typeerror-error-1009/321830/1 "2011-05-02T21:19:30Z")

</div>

Hi to you all. I’ve made preloaders in the past, but now I’m getting this error, and I don’t know what is exactly the problem. TypeError: Error #1009: Cannot access a property or method of a null object reference at com.mugui::Footer()

If I erase all references of the footer from my Main Class the flash works normal. So the problem comes from my footer, but why?.

My main class:

```auto
public class MuguiMain extends MovieClip
    {
        
        private var contentHolder:Sprite = new Sprite;
        private var mainContent:MainContent = new MainContent();
        private var footer:Footer = new Footer(); 
        private var loader:Loader;
        private var swfContent:MovieClip;
        private var swfContentHolder:Sprite = new Sprite();
        
        public function MuguiMain():void
        {
            this.addEventListener(Event.ENTER_FRAME, preload);
        }
        
        public function preload (e:Event):void
        {
            var total:Number = this.stage.loaderInfo.bytesTotal;
            var loaded:Number = this.stage.loaderInfo.bytesLoaded;
            loaderText.text = Math.floor((loaded/total)*100) + "%";
            
            if(total == loaded)
            {
                gotoAndStop("ini");
                this.removeEventListener(Event.ENTER_FRAME, preload);
                MuguiIni();
            }
        }
        
        public function MuguiIni():void
        {
            addEventListener("clickCatalogo", clickCatalogo,false,0,true);
            addEventListener("clickClose", unLoadSwf,false,0,true);
            addEventListener("clickInicio", clickInicio,false,0,true);
            addEventListener("clickQuienes", clickQuienes,false,0,true);
            addChild(contentHolder);
            contentHolder.addChild(mainContent);
            contentHolder.addChild(footer);
        }

```

My footer class:

```auto
public function Footer():void
        {
            this.x = 1000;
            this.y = 432;
            
            catalogoBtn.addEventListener(MouseEvent.CLICK, clickCatalogo,false,0,true);
            TweenMax.to(this,2,{x:523, ease:Expo.easeOut});
            catalogoBtn.buttonMode = true;
        }
        
        
        public function clickCatalogo(e:MouseEvent):void
        {
            dispatchEvent(new Event("clickCatalogo",true));
        }
    }
}

```

Hope anyone can spot the problem.  
Thank in advance for any hint on this issue.  
Greetings.
