-
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");
}
}
}
-
Flash/Flex Developer
You are not identifying exact where the menu_bar is located. You code indicates that it is local to the package, when in fact it isn't and is only available on the main timeline. You need to provide the path outside of the package.
Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.
-
Originally Posted by samac1068
You are not identifying exact where the menu_bar is located. You code indicates that it is local to the package, when in fact it isn't and is only available on the main timeline. You need to provide the path outside of the package.
How would I go about doing that?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|