# TypeError: Error #1009: Cannot access a property or method of a null object reference

**URL:** <https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/278005>\
**Category:** Uncategorized\
**Created:** [December 20, 2008, 12:39am UTC](https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/278005 "2008-12-20T00:39:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Production\_6](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@Production\_6](https://forum.kirupa.com/u/Production_6)\
**Post date:** [December 20, 2008, 12:39am UTC](https://forum.kirupa.com/t/typeerror-error-1009-cannot-access-a-property-or-method-of-a-null-object-reference/278005/1 "2008-12-20T00:39:41Z")

</div>

hello, I’m new to flash and AS3, so maybe this is a dumb question but, I have a preloader that I want to tween down the alpha and move to the next frame. I have a tween variable tweening the alpha channel down to 0 and adding an event listener that moves to the next frame. here’s my code:

```auto
stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onProgress(e:ProgressEvent):void
{
    var loaded:Number=e.target.bytesLoaded;
    var total:Number=e.target.bytesTotal;
    var pct:Number=loaded/total;
    loader_mc.scaleX=pct;
}

function onComplete(e:Event):void
{
    var loaderTween:Tween = new Tween(loaderOutline_mc,"alpha",Strong.easeOut,1,0,1,true)
    var loaderTween2:Tween = new Tween(loader_mc,"alpha",Strong.easeOut,1,0,1,true)
}

// ************NEEDS TO BE CORRECTED*************
loader_mc.addEventListener (Event.ENTER_FRAME, menuLoad);
function menuLoad (event:Event):void
    {
        //trace(loader_mc.alpha)
        if (loader_mc.alpha==0)
        {
            nextFrame();
            loader_mc.removeEventListener (Event.ENTER_FRAME, menuLoad);
        }
    }

```

when I run the application it moves to the next frame, however I get an error code that repeats consecutively reading:

TypeError: Error #1009: Cannot access a property or method of a null object reference.  
at Production\_6\_fla::MainTimeline/menuLoad()

and does not stop repeating. I can still run the program but this is really making everything run super slow… I commented out everything in the “if statement” seperately and evrything outside of the "if statement"to see where the problem lies. the problem is in the nextFrame(); code.

I tried to add "stage.nextFrame(); but that did not work, and Stage.nextFrame(); and gotoAndStop(2); and stage.gotoAndStop(2); and I really can’t figure out what is going on… I’m banging my head against the wall on this one.
