Hello all, I am new to as3 and experiencing problems with simple buttons. I am currently working on a website designed in flash for a client. What I want is the navigation button’s to gotoAndPlay a different scene. After I export the swf and the splash scene is done then the home page gives me an instant error…
“TypeError: Error #1009: Cannot access a property or method of a null object reference.
at masterTest_creatonomy_2_fla::MainTimeline/frame188()”
What happens on the home page (scene) is that only a couple of the buttons work properly. And when they do the output gives me the same error message. My script on the home scene is the same as the other scenes, except for the CLICK function name. Here is my code for the Home scene:
stop();
aboutUs_btn.addEventListener(MouseEvent.CLICK, aboutUs1Click);
function aboutUs1Click(event:MouseEvent):void{
trace("hi");
gotoAndPlay(1, "About Us");
};
services_btn.addEventListener(MouseEvent.CLICK, services1Click);
function services1Click(event:MouseEvent):void{
gotoAndPlay(1, "Services");
};
team_btn.addEventListener(MouseEvent.CLICK, team1Click);
function team1Click(event:MouseEvent):void{
gotoAndPlay(1, "Team");
};
jobs_btn.addEventListener(MouseEvent.CLICK, jobs1Click);
function jobs1Click(event:MouseEvent):void{
gotoAndPlay(1, "Jobs");
};
ourWork_btn.addEventListener(MouseEvent.CLICK, ourWork1Click);
function ourWork1Click(event:MouseEvent):void{
gotoAndPlay(1, "Our Work");
};
news_btn.addEventListener(MouseEvent.CLICK, news1Click);
function news1Click(event:MouseEvent):void{
gotoAndPlay(1, "News");
};
whatsNew_btn.addEventListener(MouseEvent.CLICK, whatsNew1Click);
function whatsNew1Click(event:MouseEvent):void{
gotoAndPlay(1, "News");
};
creatonomE_btn.addEventListener(MouseEvent.CLICK, creatonomE1Click);
function creatonomE1Click(event:MouseEvent):void{
gotoAndPlay(1, "CreatonomE");
};
creatoblog_btn.addEventListener(MouseEvent.CLICK, creatoblog1Click);
function creatoblog1Click(event:MouseEvent):void{
gotoAndPlay(1, "CreatoBlog");
};
funStuff_btn.addEventListener(MouseEvent.CLICK, funStuff1Click);
function funStuff1Click(event:MouseEvent):void{
gotoAndPlay(1, "Fun Stuff");
};
contactUs_btn.addEventListener(MouseEvent.CLICK, contactUs1Click);
function contactUs1Click(event:MouseEvent):void{
gotoAndPlay(1, "Contact Us");
};
redBox_btn.addEventListener(MouseEvent.CLICK, redBox1Click);
function redBox1Click(event:MouseEvent):void{
gotoAndPlay(1, "Fun Stuff");
};
clientLogin_btn.addEventListener(MouseEvent.CLICK, clientLogin1Click);
function clientLogin1Click(event:MouseEvent):void{
gotoAndPlay(1, "Client Login");
};
If somebody could tell me what is going on here I would appreciate it!!