# Mouse over & on click help

**URL:** https://forum.kirupa.com/t/mouse-over-on-click-help/63811
**Category:** Uncategorized
**Created:** [September 10, 2004, 4:21am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811 "2004-09-10T04:21:11Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![dynamic\_dolphin](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dynamic\_dolphin](https://forum.kirupa.com/u/dynamic_dolphin)
#### Post date: [September 10, 2004, 4:21am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/1 "2004-09-10T04:21:11Z")

</div>

Hi,  
I want to create a menu system which plays a MC on roll-over and a different MC on Click.  
I dont want them to cut out as the mouse moves of the button so i guess I have to use Actionscript.

My question is what is the correct syntax for ‘on Rollover’ to call an MC other than the one on the stage ?

Thanks,

---

<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: [September 10, 2004, 4:59am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/2 "2004-09-10T04:59:13Z")

</div>

did you search forums / tutorials / google first?

---

<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: [September 10, 2004, 5:03am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/3 "2004-09-10T05:03:32Z")

</div>

Yes, I have spent the last 4 hours searching forums and GOOGLE!

---

<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: [September 10, 2004, 5:11am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/4 "2004-09-10T05:11:47Z")

</div>

And don’t tell me u didn’t find any:h:

---

<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: [September 10, 2004, 5:18am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/5 "2004-09-10T05:18:49Z")

</div>

> [@SeaPink](#):
>
> And don’t tell me u didn’t find any:h:

I found about 5 different ways of doing it, every way I have tried does not work, I am now completely confused and need someone to just tell me the easiest way.  
I have Flash MX 2004

If you can help me please tell do so

---

<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: [September 10, 2004, 5:50am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/6 "2004-09-10T05:50:45Z")

</div>

can you show any example of what actually it is that u are trying to do…may be links to some sites…etc…or may be you can let us take a peek into your file…that way we can help u better…

---

<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: [September 10, 2004, 6:17am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/7 "2004-09-10T06:17:30Z")

</div>

I dont really have a sample but I have managed to put together something which is sort off working but its too big for me to upload in this forum. Grr.

I have done it using On Rollover, out and release, Im not sure if this is right…  
The problem now, is when the button is clicked, my MC runs fine, but the rollover MC also runs again afterwards.  
I do have STOP commands at the end of the Release MC but it doesnt help.

---

<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: [September 10, 2004, 6:29am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/8 "2004-09-10T06:29:45Z")

</div>

what i can suggest is to have some kind of a flag…

> on (rollOver){  
> if (flag == true){  
> yourRollover\_mc.play()  
> }  
> }

on(release){  
flag = false;  
yourRollover\_mc.gotoAndstop(1)  
Page\_mc.play()  
}

Hope this help…by the way set the initial value of flag to true(-:

---

<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: [September 10, 2004, 7:53am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/9 "2004-09-10T07:53:08Z")

</div>

OK.  
Thanks for that.

Using a flag I get error messages about Onclip event handlers, I dont have any of these and havent heard of it…???

My code is as follows:

flag = false;  
if (flag == true){  
on (rollOver) {gotoAndPlay(2);  
}  
on (rollOut) {gotoAndPlay(6);  
}  
}  
on (release) {  
flag = true;  
gotoAndPlay(20);  
}

Thanks again.

---

<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: [September 10, 2004, 8:23am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/10 "2004-09-10T08:23:48Z")

</div>

if (flag == true) should come inside the on(rollover){}…  
you can set the initial value of flag = true on the frames and not on the button

---

<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: [September 10, 2004, 10:42am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/11 "2004-09-10T10:42:36Z")

</div>

I have tried various combinations of this, none of them seem to behave properly.

I have zipped up my .fla and attached it.  
‘Profile’ is the menu option I am trying to work on.

Thanks

---

<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: [September 10, 2004, 10:45am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/12 "2004-09-10T10:45:24Z")

</div>

dynamic dolphin - can’t find your attachment

---

<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: [September 10, 2004, 10:45am UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/13 "2004-09-10T10:45:42Z")

</div>

Attachment.

---

<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: [September 10, 2004, 12:26pm UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/14 "2004-09-10T12:26:56Z")

</div>

Just make sure you’re placing your AS in the right place. I’d suggest giving an instance name to your MC and then placing this code on the first frame of your movie:

```auto
//define variable
_global.playStatus == isStopped;

//MC on stage named myMC
myMC.onRollOver = function() {
     if (playStatus == isStopped) {
          // pretend there's a "targetMC"
          // and that you want to play frame 2
          targetMC.gotoAndPlay(2);
          playStatus = isPlaying;
     } else {
          // if it's playing, don't do anything
          return;
     }
}

myMC.onRollOut = function() {
     if (playStatus == isStopped) {
          targetMC.gotoAndPlay(3);
          playStatus = isPlaying;
     } else {
          return;
     }
}

myMC.onRelease = function() {
     if (playStatus == isStopped) {
          targetMC.gotoAndPlay(4);
          playStatus = isPlaying;
     } else {
          return;
}

```

Then, place an actions layer within the movieclip you’re controlling setting the playStatus variable to isStopped where necessary (or isPlaying if you don’t want to define it in the function).

As long as you place the AS in the right place, have proper instance names, and declare the variable you should be golden.

---

<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: [September 10, 2004, 12:48pm UTC](https://forum.kirupa.com/t/mouse-over-on-click-help/63811/15 "2004-09-10T12:48:57Z")

</div>

Hmm,  
Well, I have entered your code and I get swamped with error messages.

I have attached the file.
