Frame label navigation problem

Hi I hope some one can help me this is driving me crazy.

I’m trying to create a simple frame label based navigation. If you see the attached file it’s not very complex but whenever I click the red button I keep getting

ArgumentError: Error #2109: Frame label instance3 not found in scene Scene 1.
at flash.display::MovieClip/gotoAndPlay()
at site01_fla::MainTimeline/site01_fla::frame21()

I had it working fine but this started happening when I made the red button a MovieClip containing its own frame labels for the up, down, over states.

can anybody help please

thank you

i bet if you traced nextSection it would return either red or green, i nother words, you are getting the event target which is the button, so you need to call

no, wait scratch that

try this and see if it helps

red.buttonMode = green.buttonMode = true;
red.mouseChildren = green.mouseChildren = false;

ok, thats my guess, if it doesn’t work maybe i’ll try a more educated on and try and trace out what (instance3) is :drool:

The construction of your buttons is not correct for this script.
The nested symbol “red button bg” is the likely culprit; events are propagating through the red and green buttons to this symbol and returning its name “instance3”.

Simply build your buttons from shapes nested in movieclips.
If you need different colored buttons, duplicate the button within the library, and rename it.
You can then open this duplicate symbol and change the color of the nested shape without affecting the other button symbols.

BTW, here’s a simple script based on the same techniques for you to experiment with.
The difference is that the entire project is on frame1 of the main timeline.

[LIST=1]
[]Paste the script on frame1 “actions” layer.
[
]Nest your buttons “red” and “green” in a new movieclip “buttonGroup” on it’s own layer on frame1.
[*]Place the “redBox” and “greenBox” movieclips on the stage on separate layers in frame1.
[/LIST]
[COLOR=“Blue”]TweenMax[/COLOR] is required for this script to work.
I promise, you will love TweenMax once you understand how to use it effectively.

stop();
import gs.TweenMax;
import fl.motion.easing.*;

buttonGroup.addEventListener(MouseEvent.CLICK, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OVER, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OUT, action, false, 0, true);
buttonGroup.mouseEnabled = false;
buttonGroup.buttonMode = true;

var boxArray:Array = [redBox, greenBox];
TweenMax.allTo(boxArray, 0, {autoAlpha:0, rotation:360, scaleX:.05, scaleY:.05, dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:45, distance:0}});

var button:String = "";

function action(event:MouseEvent):void {
	button = event.target.name;
	switch (event.type) {
		case MouseEvent.MOUSE_OVER :
			TweenMax.to(event.target, .6, {scaleX:1.3, scaleY:1.3, ease:Elastic.easeOut});
			break;
		case MouseEvent.MOUSE_OUT :
			TweenMax.to(event.target, .6, {scaleX:1, scaleY:1, ease:Cubic.easeOut});
			break;
		case MouseEvent.CLICK :
			TweenMax.allTo(boxArray, .6, {autoAlpha:0, rotation:360, scaleX:.05, scaleY:.05, dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:45, distance:0}});
			TweenMax.to(event.target, .6, {scaleX:1, scaleY:1, ease:Cubic.easeOut});
			switch (button) {
				case "red" :
					TweenMax.to(redBox, 2.4, {delay:.6, autoAlpha:1, rotation:0, scaleX:1, scaleY:1, ease:Elastic.easeOut, dropShadowFilter:{color:0x000000, alpha:0.5, blurX:4, blurY:4, angle:45, distance:8}, overwrite:true});
					break;
				case "green" :
					TweenMax.to(greenBox, 2.4, {delay:.6, autoAlpha:1, rotation:0, scaleX:1, scaleY:1, ease:Elastic.easeOut, dropShadowFilter:{color:0x000000, alpha:0.5, blurX:4, blurY:4, angle:45, distance:8}, overwrite:true});
					break;
			}
			break;
	}
}

Grnd Master and[URL=“http://www.kirupa.com/forum/member.php?u=102867”] Snikelfritz thanks for taking the time to respond

Snikelfritz thank you for you in depth response! I will try it out and let you know how I get on. I am just learning Actionscript 3 at the moment and it seems quite a steep learning curve but I’m determined to learn and getting a response like yours fills me with enthusiasm

thank you