# Some code help

**URL:** <https://forum.kirupa.com/t/some-code-help/112819>\
**Category:** Uncategorized\
**Created:** [June 11, 2004, 5:16pm UTC](https://forum.kirupa.com/t/some-code-help/112819 "2004-06-11T17:16:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geestring](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geestring](https://forum.kirupa.com/u/geestring)\
**Post date:** [June 11, 2004, 5:16pm UTC](https://forum.kirupa.com/t/some-code-help/112819/1 "2004-06-11T17:16:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 6:35pm UTC](https://forum.kirupa.com/t/some-code-help/112819/2 "2004-06-11T18:35:20Z")

</div>

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:

```auto

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 6:42pm UTC](https://forum.kirupa.com/t/some-code-help/112819/3 "2004-06-11T18:42:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 6:43pm UTC](https://forum.kirupa.com/t/some-code-help/112819/4 "2004-06-11T18:43:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 7:25pm UTC](https://forum.kirupa.com/t/some-code-help/112819/5 "2004-06-11T19:25:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 11, 2004, 7:34pm UTC](https://forum.kirupa.com/t/some-code-help/112819/6 "2004-06-11T19:34:45Z")

</div>

Can i see your fla?
