View Full Version : Newbie help, Controlling MC's
theRonster
July 6th, 2005, 01:14 PM
I have created movie clips for buttons to enable a visited state. (buttons control MC with up, down and visited states in time line).
What I would like to do next is set a script that will go to a specific frame in that MC depending on who clicks.
Basically, it's a game, and I need different rollover colours for 2 separate players. Player one clicks and the visited state goes blue. Player 2 clicks and the visited state goes red.
Can I do this with a smart clip and action script?
Any pointers much appreciated.
Seb Hughes
July 6th, 2005, 01:48 PM
can you post a fla ?
mathew.er
July 6th, 2005, 10:38 PM
I have created movie clips for buttons to enable a visited state. (buttons control MC with up, down and visited states in time line).
What I would like to do next is set a script that will go to a specific frame in that MC depending on who clicks.
Basically, it's a game, and I need different rollover colours for 2 separate players. Player one clicks and the visited state goes blue. Player 2 clicks and the visited state goes red.
Can I do this with a smart clip and action script?
Any pointers much appreciated.
from what you sad i understand that in your game two players are switching rounds and only one player is active all the times(unless its not a multiplayer game or you have two mice ;) ).
you have to declare a variable to know who is active and than simply use some condition to decide to which frame you send your mc.
fro ex.
//red player is active
activePlayer = "red"
//myMc is your multi-color button
myMc.onRelease = function() {
if(activePlayer == "red") {
//red is active -> go to frame 1
myMc.gotoAndStop(1);
}
if(activePlayer == "blue") {
//red is active -> go to frame 2
myMc.gotoAndStop(2);
}
};
hope it helps
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.