# Infinite Menu problem

**URL:** https://forum.kirupa.com/t/infinite-menu-problem/14320
**Category:** flash
**Created:** [February 25, 2003, 1:23am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320 "2003-02-25T01:23:15Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Goofycabal](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Goofycabal](https://forum.kirupa.com/u/Goofycabal)
#### Post date: [February 25, 2003, 1:23am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/1 "2003-02-25T01:23:15Z")

</div>

I’m completely new to using Flash (and have no experience using coding…) and have got a real problem…

I followed the tutorial for creating an Infinite Menu and have got that to work.

Problem: I want each of the 4 seperate images in the Infinite Menu I have created to have their own seperate Buttons that will each open different URLs in new windows.

I can get the button to open the URL, but can’t ‘stick’ the button to the moving image (they just sit there while the images scroll).

Could somebody suggest the code I should use to get this to work, as I have no idea how to set it up myself…

---

<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: [February 25, 2003, 11:10pm UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/2 "2003-02-25T23:10:02Z")

</div>

Anybody…?

---

<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: [February 25, 2003, 11:16pm UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/3 "2003-02-25T23:16:04Z")

</div>

without the code or fla it’s hard to tell you how could you achieve it …

but why don’t you place the buttons inside the same movie clip as the image ?? 🙂

---

<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: [February 26, 2003, 1:29am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/4 "2003-02-26T01:29:38Z")

</div>

Cheers for that, I’ll see if I can figure out how to do that…

---

<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: [February 26, 2003, 1:46am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/5 "2003-02-26T01:46:19Z")

</div>

ok =)

if you have any problems attach your file …

---

<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: [February 26, 2003, 3:30am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/6 "2003-02-26T03:30:27Z")

</div>

Well, as a matter of fact, I still can’t figure it out…

I won’t attach the file, cause its currently 3Megs in size…

The code for the movie clip part of the file is

onClipEvent (load) {  
xcenter = 150;  
speed = 1/50;  
}  
onClipEvent (enterFrame) {  
var distance = \_root.\_xmouse-xcenter;  
\_x += (distance\*speed);  
if (\_x\>0) {  
\_x = -608;  
}  
if (\_x\<-608) {  
\_x = 0;  
}  
}

and I was wondering whether it was possible to alter this in some way to work for a button…?

The only other thing I can think of would be attaching the original file for the Infinite Menu that I downloaded from the Kirupa tutorial pages…

Cheers for whatever help you can give…

---

<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: [February 26, 2003, 5:04am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/7 "2003-02-26T05:04:15Z")

</div>

lol … you’re using **buttons** not **movie clips** as buttons ? 🙂

sorry … my mistake. is just that i never use buttons [size=1]personally i think that they are useless now in **mx** [/size] so … there’s no way to get the script working in a button.  
use movie clips instead =)

---

<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: [February 26, 2003, 6:39am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/8 "2003-02-26T06:39:23Z")

</div>

Ah… That actually seems to be a better solution…

Only problem is, now when I test the movie, it opens the URL straight away, instead of when I click on the movie clip…

How do I set it up to open the URL ONLY when the movie clip is clicked on…?

I feel really silly asking so much, but I really have no idea how to do this… But I am learning…

Cheers…

---

<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: [February 26, 2003, 6:49am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/9 "2003-02-26T06:49:10Z")

</div>

again … without the code or fla it’s hard to tell what the problem is

but you should have in the mc actions something like:

```auto
on (release) {
getURL("http://www.somewhere.com", " **_self**");
}

```

**\_self** specifies the current frame in the current window  
**\_blank** specifies a new window  
**\_parent** specifies the parent of the current frame  
**\_top** specifies the top-level frame in the current window

---

<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: [February 27, 2003, 12:24am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/10 "2003-02-27T00:24:54Z")

</div>

Sweet as !

That worked perfectly… After a bit of messing around with orders and groupings…

Cheers :beam:

---

<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: [May 4, 2003, 5:51am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/11 "2003-05-04T05:51:53Z")

</div>

Hey can u guys tell me how u guys did your buttons by using movie clips cause i tried it but it doesn’t work. All i know is that when i made the infinite menu into a movie clip, i can’t click on the menu buttons. And when i put the menu into movie clip and edit it into a button symbol, it still doesn’t work with the GOTOANDPLAY functions.

---

<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: [May 4, 2003, 6:02am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/12 "2003-05-04T06:02:52Z")

</div>

1. chances are you’re publishing the swf to flash 5.

2. are you trying to play a different scene?  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22333](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22333)

:-\

---

<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: [May 4, 2003, 9:23pm UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/13 "2003-05-04T21:23:55Z")

</div>

Thankz for the reply, i think i found the answer that i was looking for at

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22471](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=22471)

---

<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: [May 4, 2003, 11:41pm UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/14 "2003-05-04T23:41:37Z")

</div>

would it be to much to ask for a little help here…?

---

<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: [May 5, 2003, 12:15am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/15 "2003-05-05T00:15:26Z")

</div>

well, i don’t have flash installed in this pc. :-  
but you have to adjust the variables depending on the x and width of your menu…

this script should get the correct values for you:

```auto
onClipEvent (load) {
xcenter = _x+_width/4;
speed = 1/10;
xright = _x;
xleft = _x-_width/2;
}
onClipEvent (enterFrame) {
var distance = _root._xmouse-xcenter;
_x += distance*speed;
if (_x>xright) _x = xleft;
if (_x<xleft) _x = xright;
}

```

now you only need to change the value of the variable speed if needed. =)

---

<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: [May 5, 2003, 12:28am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/16 "2003-05-05T00:28:12Z")

</div>

> \*Originally posted by kax \*  
> \*\*well, i don’t have flash installed in this pc. :-  
> but you have to adjust the variables depending on the x and width of your menu…

this script should get the correct values for you:

```auto
onClipEvent (load) {
xcenter = _x+_width/4;
speed = 1/10;
xright = _x;
xleft = _x-_width/2;
}
onClipEvent (enterFrame) {
var distance = _root._xmouse-xcenter;
_x += distance*speed;
if (_x>xright) _x = xleft;
if (_x<xleft) _x = xright;
}

```

now you only need to change the value of the variable speed if needed. =) \*\*

is that for my problem? cuaes if so were do i put it? do i replace it with the existing code, or put it in a diferent key frame… thx

---

<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: [May 5, 2003, 12:32am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/17 "2003-05-05T00:32:06Z")

</div>

yes, that’s for your problem.  
yes, replace the existing code.

---

<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: [May 5, 2003, 12:35am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/18 "2003-05-05T00:35:49Z")

</div>

haha, u own all, thanks a bunch man!

---

<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: [May 5, 2003, 12:40am UTC](https://forum.kirupa.com/t/infinite-menu-problem/14320/19 "2003-05-05T00:40:37Z")

</div>

no problem. 😉
