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