# Navigation actions. help

**URL:** https://forum.kirupa.com/t/navigation-actions-help/3535
**Category:** Uncategorized
**Created:** [October 23, 2001, 12:39pm UTC](https://forum.kirupa.com/t/navigation-actions-help/3535 "2001-10-23T12:39:55Z")
**Posts on this page:** 5
**Page:** 1

<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: [October 23, 2001, 12:39pm UTC](https://forum.kirupa.com/t/navigation-actions-help/3535/1 "2001-10-23T12:39:55Z")

</div>

okay, I have six invisible buttons over a movie clip on my main timeline. Each on of those buttons calls multiple movie clips to play on a rollover. The problem I’m having is figuring out how to stop a rollerover action that happens on button 1 when the user rolls over button 2 or any other button. I’m wondering if there is a way to do this with variables.

Can anyone help?

Erik

---

<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: [October 23, 2001, 5:31pm UTC](https://forum.kirupa.com/t/navigation-actions-help/3535/2 "2001-10-23T17:31:10Z")

</div>

in frame one, \_root:

```auto
 
// build an array of all the rollover movies
movies = ["firstmovie","anothermovie" ... "lastmovie"];

```

then in each button:

```auto
     
on(rollover){
_ _ _ _ for(j=0;j<_root.movies.length;j++){
_ _ _ _ _ _ _ _ _root[_root.movies[j]].gotoAndStop(1);
_ _ _ _ }
_ _ _ _ ... the rest of the button actions ...
}

```

that will make every movie in the movies array gotoAndStop(1), then you can make the one you want do something.

is that enough, or would you like more clarification?

---

<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: [October 23, 2001, 6:51pm UTC](https://forum.kirupa.com/t/navigation-actions-help/3535/3 "2001-10-23T18:51:11Z")

</div>

That sounds good. I’ll try and mess around with it a little. I don’t understand the “j” stuff. could explain a little more?

thanks so much  
Erik

---

<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: [October 23, 2001, 8:55pm UTC](https://forum.kirupa.com/t/navigation-actions-help/3535/4 "2001-10-23T20:55:23Z")

</div>

it’s a for loop, especially useful for cycling through an array.

the first part (j=0) is the initial declaration, the second (j\<\_root.movies.length) is the test which it will run to see whether to continue running the loop or not, and the third (j++) is what it should do at the end of each loop, in this case increment j by 1.

so it runs the loop with j equaling 0 and will evaluate the first (0 index) element in \_root.movies, and tell it to gotoAndStop(1). then it will increment j, test it, see that’s it’s still less than the length of \_root.movies so run the code again. with j equaling 1. etc etc, until j = \_root.movies.length, then the test has failed and it will move on to the next line in the code - after the for loop.

more?

---

<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: [October 24, 2001, 11:25am UTC](https://forum.kirupa.com/t/navigation-actions-help/3535/5 "2001-10-24T11:25:57Z")

</div>

that’s great!! thanks. I’ll post another question if I have anything further.

Thanks  
Erik
