Mouse over & on click help

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,

did you search forums / tutorials / google first?

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

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

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…

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.

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(-:

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.

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

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

dynamic dolphin - can’t find your attachment

Attachment.

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:

//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.

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

I have attached the file.