views:

21

answers:

1

Hey Guys...need help. Working on a project and get this error on the Output Log

TypeError: Error #1009: Cannot access a property or method of a null object reference. at FlashSite_fla::MainTimeline/frame16()

Here's every frame that is on, begins, or crosses frame 16

Layer Name: Top Menu (4 Button named Home_btn, Works_btn, Tech_btn, Contact_btn)
Code attached to frame:
stop();
Home_btn.addEventListener(MouseEvent.CLICK, home);
function home(event:MouseEvent):void {
gotoAndStop(16);
}
Works_btn.addEventListener(MouseEvent.CLICK, works);
function works(event:MouseEvent):void {
gotoAndStop(17);
}
Tech_btn.addEventListener(MouseEvent.CLICK, tech);
function tech(event:MouseEvent):void {
gotoAndStop(18);
}
Contacts_btn.addEventListener(MouseEvent.CLICK, contact);
function contact(event:MouseEvent):void {
gotoAndStop(19);
}
Layer Name: Investment Opp (button named Invest_btn)
Code attached to frame:
Invest_btn.addEventListener(MouseEvent.CLICK, invest);
function invest(event:MouseEvent):void {
var link:URLRequest = new URLRequest('#');
navigateToURL(link);
}
Layer Name: MfgOpp (Button named Mfg_btn)
Code attached to frame:
Mfg_btn.addEventListener(MouseEvent.CLICK, mfg);
function mfg(event:MouseEvent):void {
var link:URLRequest = new URLRequest('#');
navigateToURL(link);
}
Layer Name: MarketResearch (button name Own_btn)
Code attached to frame:
Own_btn.addEventListener(MouseEvent.CLICK, own);
function own(event:MouseEvent):void {
var link:URLRequest = new URLRequest('#');
navigateToURL(link);
}
Layer Name: ActionScript
Code attached to frame:
import flash.events.MouseEvent;

What am I doing wrong?!?!

A: 

not familiar to fash cs4 but as for prevois version
imports where done in the same layer:
move import flash.events.MouseEvent; to where Mfg_btn.addEventListener(MouseEvent.CLICK, mfg); is
or just try all code in one layer, with 'import flash.events.MouseEvent;' beeing first

dnkira
Tried that, same error.
Okay...so, all the buttons for the above code work perfectly for the Menu...however the 3 listed on the bottom are not working at all. They are viewed as a button, but not functioning...not directing the click to provided link (I know my example is using # as the url, but I've changed it to the appropriate page) DON"T KNOW WHAT"S WRONG!
sorry, can't install cs4. currently bussy with my own projects. if problem remains untill when i'm done will set up and try to figure out. by the way in flash 8 i had some unhandleable bug and "got out" copying content in new file... the code was 100% working...as for what i can say... use debug or setp by step creation and tacing if flash know what to handle...for example i whould try from start.. ActionScript creation\trace\adding a behavior\trace\inside behavoir\trace\and testing a funtion...
dnkira