# Simple code problem,need fresh eyes

**URL:** <https://forum.kirupa.com/t/simple-code-problem-need-fresh-eyes/312507>\
**Category:** Uncategorized\
**Created:** [August 5, 2010, 10:37am UTC](https://forum.kirupa.com/t/simple-code-problem-need-fresh-eyes/312507 "2010-08-05T10:37:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somdow](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@somdow](https://forum.kirupa.com/u/somdow)\
**Post date:** [August 5, 2010, 10:37am UTC](https://forum.kirupa.com/t/simple-code-problem-need-fresh-eyes/312507/1 "2010-08-05T10:37:46Z")

</div>

how do i know its simple…i dunno but knowing me…its pretty stupid and probably right under my nose…

im studying AS3 (after a long hiatus and trying to get back to flash)

so im doing this small site to test myself and while declaring my buttons (code below) i get a 1099 error saying

> TypeError: Error #1009: Cannot access a property or method of a null object reference.  
> at main\_fla::MainTimeline/frame1()

i have no idea what this means.

heres ALL i have on frame one so far.

```auto
import flash.events.MouseEvent;
import flash.ui.Mouse;
import flash.net.URLRequest;

//MY BUTTON declarations. THEIR LISTENERS AND THEIR FUNCTIONS below.

aboutBtn.addEventListener(MouseEvent.CLICK,aboutbtn);
function aboutbtn(e:MouseEvent):void
{
	gotoAndPlay("about");
}

contactBtn.addEventListener(MouseEvent.CLICK,contactbtn);
function contactbtn(e:MouseEvent):void
{
	gotoAndPlay("contact");
}

portfolioBtn.addEventListener(MouseEvent.CLICK,portfoliobtn);
function portfoliobtn(e:MouseEvent):void
{
	gotoAndPlay("portfolio");
}

homeBtn.addEventListener(MouseEvent.CLICK,homebtn);
function homebtn(e:MouseEvent):void
{
	gotoAndPlay("home");
}

followMeBtn.addEventListener(MouseEvent.CLICK,followmebtn);
function followmebtn(e:MouseEvent):void
{
	navigateToURL(new URLRequest("http://www.twitter.com/somdow"), "_blank");
}

// Btns in the port section.

port2ImgBtn.addEventListener(MouseEvent.CLICK,port2imgbtn);
function port2imgbtn(e:MouseEvent):void
{
	trace("btn clicked");
}

port1ImgBtn.addEventListener(MouseEvent.CLICK,port1imgbtn);
function port1imgbtn(e:MouseEvent):void
{
	trace("btn clicked lol");
}

```

any ideas??? im lost
