New AS file won't recognize my instance names
I get the error "Access of undefined property menu_bar" when menu_bar is an instance name directly on the main timeline. I'm not sure how I would call it in the other class. It also isn't exported for actionscript is that the problem?
I have it imported to my document class as:
var mouseClicks:MouseClicks = new MouseClicks();
addChild(mouseClicks);
Then the class looks like this:
Code:
package{
import flash.display.MovieClip;
import flash.events.*;
public class MouseClicks extends MovieClip{
public function MouseClicks(){
menu_bar.about_us.aboutUs_button.about_hitbox.addEventListener(MouseEvent.CLICK, _handleAboutClick);
/* menu_bar.about_us.RTB.readyToBuy.rtb_hitbox.addEventListener(MouseEvent.CLICK, _handleRtbClick);
menu_bar.about_us.RTB.portfolio.portfolio_button.p_hitbox.addEventListener(MouseEvent.CLICK, _handlePortfolioClick);
menu_bar.about_us.RTB.portfolio.services.s_button.s_hitbox.addEventListener(MouseEvent.CLICK, _handleServicesClick);
menu_bar.about_us.RTB.portfolio.services.design_options.designOptions_button.do_hitbox.addEventListener(MouseEvent.CLICK, _handleDOClick);*/
}
public function _handleAboutClick(MouseEvent:Event):void{
trace("clicked");
}
}
}