Hi guys,
I'm fairly new to ActionScript, so bear with me.
The design of my pages means that certain links appear only after clicking another one (in this instance, if you click on "Photography" a number of links to pages/frames with photography in them appear)
I keep getting this error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at page_fla::MainTimeline/frame2()
at flash.display::MovieClip/gotoAndStop()
at page_fla::MainTimeline/goHome()
Here's a copy of my script:
Code:
stop();
function goHome (e:MouseEvent):void{
gotoAndStop("home");
}
home_btn.addEventListener(MouseEvent.CLICK, goHome);
function goDesign (e:MouseEvent):void{
gotoAndStop("design_1");
}
design_btn.addEventListener(MouseEvent.CLICK, goDesign);
function goPhotography_1 (e:MouseEvent):void{
gotoAndStop("photography_1");
}
photography_btn.addEventListener(MouseEvent.CLICK, goPhotography_1);
function goPhotography_1a (e:MouseEvent):void{
gotoAndStop("photography_1");
}
photography_1_btn.addEventListener(MouseEvent.CLICK, goPhotography_1a);
function goPhotography_2 (e:MouseEvent):void{
gotoAndStop("photography_2");
}
photography_2_btn.addEventListener(MouseEvent.CLICK, goPhotography_2);
function goPhotography_3 (e:MouseEvent):void{
gotoAndStop("photography_3");
}
photography_3_btn.addEventListener(MouseEvent.CLICK, goPhotography_3);
function goPhotography_4 (e:MouseEvent):void{
gotoAndStop("photography_4");
}
photography_4_btn.addEventListener(MouseEvent.CLICK, goPhotography_4);
function goPhotography_5 (e:MouseEvent):void{
gotoAndStop("photography_5");
}
photography_5_btn.addEventListener(MouseEvent.CLICK, goPhotography_5);
From what I could gather, it was trying to initialize a link in frame 2 that didn't appear until frame 8, so I tried moving the script functions "goPhotography_1a" down to "goPhotography_5" to frame 8 but got the error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at page_fla::MainTimeline/frame8()
at flash.display::MovieClip/gotoAndStop()
at page_fla::MainTimeline/goPhotography_1()
I'm not sure if it's the same problem or a different one, but the links/buttons that appear in frame 8 don't lead anywhere. All my frames are labeled correctly.
Being new to ActionScript, I really have no clue where the problem lies.