# Help with Error # 1009

**URL:** <https://forum.kirupa.com/t/help-with-error-1009/332647>\
**Category:** flash\
**Created:** [September 6, 2014, 11:04pm UTC](https://forum.kirupa.com/t/help-with-error-1009/332647 "2014-09-06T23:04:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrhartsclube](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@mrhartsclube](https://forum.kirupa.com/u/mrhartsclube)\
**Post date:** [September 6, 2014, 11:04pm UTC](https://forum.kirupa.com/t/help-with-error-1009/332647/1 "2014-09-06T23:04:17Z")

</div>

Hi friends  
If you know me, you would also know that I was working AS2 and I can do almost anything with AS2, but Im migrating to AS3 and I’m a newbe.  
considering that, I realized, this error is happen when something that not suppose to be Null, be Null. but I can’t figure it out in my project, even after debugging!

Here is what’s happened:  
I used this guy class of [frames fade transition](https://github.com/Abrahamh08/Frame-Transitions-AS3) and it works fine on one of my frames but on another frame it works but with this error!!

My declaration which gives me error:

```php
Fade.fadeIntoFrame(root,stage,"step2");

```

well root and stage are predefined! “step2” is my frame label! I have same situation on my previous frame too! I cant figure it out! what should I do?  
my whole code:

```php

//mainMenu Frame
stop();

//EVENT LISTENERS
tt_btn.addEventListener(MouseEvent.CLICK,onClick1);
uw_btn.addEventListener(MouseEvent.CLICK,onClick1);
ec_btn.addEventListener(MouseEvent.CLICK,onClick1);
pp_btn.addEventListener(MouseEvent.CLICK,onClick1);
ut_btn.addEventListener(MouseEvent.CLICK,onClick1);

//EVENT HANDLERS;
function onClick1(event:MouseEvent):void
{
    switch (event.target)
    {
        case tt_btn :
            Fade.fadeIntoFrame(root,stage,"tT");
            break;
        case uw_btn :
            gotoAndStop("uW");
            break;
        case ec_btn :
            gotoAndStop("eC");
            break;
        case pp_btn :
            gotoAndStop("rP");
            break;
        case ut_btn :
            gotoAndStop("uT");
            break;
    }
}

//tt Frame
stop();
b0_btn.addEventListener(MouseEvent.CLICK,onClick2);
b1_btn.addEventListener(MouseEvent.CLICK,onClick2);
b2_btn.addEventListener(MouseEvent.CLICK,onClick2);
b3_btn.addEventListener(MouseEvent.CLICK,onClick2);
b4_btn.addEventListener(MouseEvent.CLICK,onClick2);
b5_btn.addEventListener(MouseEvent.CLICK,onClick2);
b6_btn.addEventListener(MouseEvent.CLICK,onClick2);
b7_btn.addEventListener(MouseEvent.CLICK,onClick2);
b8_btn.addEventListener(MouseEvent.CLICK,onClick2);
b9_btn.addEventListener(MouseEvent.CLICK,onClick2);
next_btn.addEventListener(MouseEvent.CLICK,onClick2);
prev_btn.addEventListener(MouseEvent.CLICK,onClick2);
del_btn.addEventListener(MouseEvent.CLICK,onClick2);

function onClick2(event:MouseEvent):void
{
    var num:String = new String("");
    error_txt.text = "";
    switch (event.target)
    {
        case b0_btn : num = "0"; break;
        case b1_btn : num = "1"; break;
        case b2_btn : num = "2"; break;
        case b3_btn : num = "3"; break;
        case b4_btn : num = "4"; break;
        case b5_btn : num = "5"; break;
        case b6_btn : num = "6"; break;
        case b7_btn : num = "7"; break;
        case b8_btn : num = "8"; break;
        case b9_btn : num = "9"; break;
        case del_btn :
            capacity_txt.text = capacity_txt.text.substring(0,capacity_txt.text.length - 1);
            break;
        case prev_btn :
            Fade.fadeIntoFrame(root,stage,"mainMenu");
            break;
        case next_btn :
            if ((capacity_txt.text.length==0) || (capacity_txt.text == "0"))
            {
                error_txt.text = "No Capacity Entered";
            }
            else if (Number(capacity_txt.text) > 240)
            {
                error_txt.text = "Maximum Capacity Overflow";
            }
            else
            {
                Fade.fadeIntoFrame(root,stage,"step2");
            }
            break;
    }
    if (capacity_txt.text.length < 3) //This is line 76 which error says
    {
        if ((capacity_txt.text == "0")&&(num!=""))
        {
            capacity_txt.text = num;
        }
        else
        {
            capacity_txt.text += num;
        }
    }
}

```

And the error:

```auto

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at NewProject_fla::MainTimeline/onClick2()[NewProject_fla.MainTimeline::frame5:76]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at NewProject_fla::MainTimeline/onClick2()[NewProject_fla.MainTimeline::frame5:76]

```

---

<div class="post-metadata">

**Author:** ![mrhartsclube](https://avatars.discourse-cdn.com/v4/letter/m/67e7ee/32.png) [@mrhartsclube](https://forum.kirupa.com/u/mrhartsclube)\
**Post date:** [October 11, 2014, 11:09pm UTC](https://forum.kirupa.com/t/help-with-error-1009/332647/2 "2014-10-11T23:09:00Z")

</div>

[QUOTE=snickelfritz;2662844]try using: _event.currentTarget_[/QUOTE]

thanks for reply.  
it doesn’t change anything! I still getting that error and I figured out that the error is because of the gotoandstop and timeline navigating functions, but I don’t know how to solve it!  
Please help
