Flash q
- Started
- Last post
- 7 Responses
- DBitW
Ok so I am making a menu by duplicating movieclips.
My question is, How can I speak to the other movieclips so that when 1 movie clip is selected it tells the others to turn off, e.g. give them a gotoAndStop, action?
- unfittoprint0
//within the MC.
function activate(status){
if(status){
_root.active.activate(false);
_root.active = this
this.gotoAndStop("on);
} else {
this.gotoAndStop("off");
}this.onPress(){
this.activate(true);
}
- DBitW0
Thank you unfit, but that doesn't tell the other duplicated mc's to gotoAndStop("off")
your help is very very appreciated
- gabriel20
as you're duplicating the clips store them into an array you can access later:
myArray.push(myDupedClip);
then step through this array later to give all clips an action.
- unfittoprint0
you should write that AS inside the symbol in your library.
What the function does is to create a variable in _root that mirrors the active MC. When another one is pressed it de-activates the MC that the variable holds, activates itself in the process and gives the variable a new value [itself].
- DBitW0
ok maybe i can elaborate,
so I have a mc named clone that is being duped
inside of clone on the first frame i have this
function activate(status) {
if (status) {
_root.active.activate(false);
_root.active = this;
this.gotoAndStop("on");
} else {
this.gotoAndStop("off");
}
}on the button i have
on(press){
this.activate = true;
}but nothing is happenin, :(
- unfittoprint0
I fought the movieclips would act like buttons, so the onPress was to be included with the tother function inside the symbol.
but since you want to target them using an outside button you should call their instance name:
//write AS on a layer instead and name your buttons
button1.onPress(){
instance1.activate(true);
}button2.onPress(){
instance2.activate(true);
}. . .
- DBitW0
thanx playa!!!!!!!