Some code help

on mousedown, i want my page to play orange-outro, and the go to contact page. this is the code on my contact button. i made the variable nextsection which equals “contact” the framelabel of the contact page. but it will play orangeoutro first,

onClipEvent (mouseDown) {
nextsection=“contact”;
_root.gotoAndPlay(“orange-outro”);
}

_root.gotoAndPlay(nextsection); at the end of my orange-outro,

this doesnt seem to work, any ideas?

Where did you place that code?
From what i can see, you are defining the variable nextmovie inside a movieclip, and then trying to access it from the main timeline.
Try:


onClipEvent (mouseDown) {
	_root.nextsection = "contact";
	_root.gotoAndPlay("orange-outro");
}

yea, i did that, but now i put the same code for a different button,
_root.nextsection=“portfolio”;

and after the orangeoutro plays, _root.gotoAndPlay("_root.nextsection");

since both contact and portfolio have the same variable, what should i do, seems like both cannot be using the same var.

so right now portfolio and contact button goes to portfolio page. contact should be going to contact.

You can use the same variable and each button will assign a different value to the variable.

And it should be: _root.gotoAndPlay(_root.nextsection);//without quotes since nextsection is a variable

but its not assigning its own value, portfolio button and contact button both go to portfolio page

Can i see your fla?