-
1. Re: How to disable/enable other buttons when one is active?
vivekuma Oct 8, 2014 12:46 AM (in response to ianloh123)Hi,
Use the below code:
1. In compositionReady handler:
Add:
sym.$(".elf").hide();
sym.setVariable("count", 200);
this.checkIfActiveSymbol = function(childSym){
var bActiveSymbol = sym.getVariable("symName");
if(bActiveSymbol && (bActiveSymbol != childSym.name))
return false;
return true;
}
this.setActiveSymbol = function(childSym) {
var bActiveSymbol = sym.setVariable("symName", childSym.name);
}
this.resetActiveSymbol = function() {
var bActiveSymbol = sym.setVariable("symName", "");
}
2. For click handler for each btn symbol:
Replace: use btn1 and btn accordingly for each button symbol.
var childSym = sym.getSymbol("btn1");
var pos = childSym.getPosition();
if(!sym.checkIfActiveSymbol(childSym))
return;
if (pos < 499) {
sym.setActiveSymbol(childSym);
sym.getSymbol("btn1").play("1");
sym.getSymbol("btn1").$("name").fadeToggle();
sym.getSymbol("btn1").$("mailbtn").fadeToggle();
}
if (pos > 501) {
sym.resetActiveSymbol();
sym.getSymbol("btn1").playReverse(pos);
sym.getSymbol("btn1").$("name").fadeToggle();
sym.getSymbol("btn1").$("mailbtn").fadeToggle();
}
var count = sym.getVariable("count");
sym.getSymbol("btn1").getSymbolElement().css({"z-index":count});
sym.setVariable("count", count+1);
hth,
Vivekuma
-
2. Re: How to disable/enable other buttons when one is active?
ianloh123 Oct 8, 2014 1:35 AM (in response to vivekuma)yup that did the trick, n then some...
I will learn from this, vivekuma! ur help is not in vain!



