Michgelsen
18th February 2005, 19:57
Ok, I need to have two togglebuttons that control the same function.
Now, I started with one, which worked, and later added the second one.
When I click the second one, the first one is supposed to change along. That works, but the function the first one controls doesn't switch along.
Example: The first one is "on". Thus the second one looks as if it's "on". When I click the first one, it goes off, and the function it controls goes off. The second one looks off now too. Everything ok.
But, when they both are on and I click the second one, they both LOOK like they are off but they aren't! My notifier (that what it's for) still keeps poppin' up.
Here's my maki, what do I do wrong..?
//System.onScriptLoaded() section
onoff = eq.getObject("notifieronoff");
alwaysselector = eq.getObject("alwaysselector");
onoff2 = eq.getObject("notifieronoff2");
alwaysselector2 = eq.getObject("alwaysselector2");
if(getPrivateInt("AudioRack", "notifieronoff", on) == 1) {on = 1;}
if(getPrivateInt("AudioRack", "notifieronoff", on) != 1) {on = 0;}
if(on == 1) {onoff.setActivated(1); onoff2.setActivated(1);}
if(on == 0) {onoff.setActivated(0); onoff2.setActivated(0);}
if(getPrivateInt("AudioRack", "minimizedonly", always) == 1) {always = 1;}
if(getPrivateInt("AudioRack", "minimizedonly", always) != 1) {always = 0;}
if(always == 1) {alwaysselector.setActivated(1); alwaysselector2.setActivated(1);}
if(always == 0) {alwaysselector.setActivated(0); alwaysselector2.setActivated(0);}
}
Onoff.onLeftButtonUp(int x, int y) {
on = onoff.getActivated();
onoff2.setActivated(on);
}
Onoff2.onLeftButtonUp(int x, int y) {
onoff.leftClick();
}
Alwaysselector.onLeftButtonUp(int x, int y) {
always = alwaysselector.getActivated();
alwaysselector2.setActivated(always);
}
Alwaysselector2.onLeftButtonUp(int x, int y) {
alwaysselector.leftClick();
}
Now, I started with one, which worked, and later added the second one.
When I click the second one, the first one is supposed to change along. That works, but the function the first one controls doesn't switch along.
Example: The first one is "on". Thus the second one looks as if it's "on". When I click the first one, it goes off, and the function it controls goes off. The second one looks off now too. Everything ok.
But, when they both are on and I click the second one, they both LOOK like they are off but they aren't! My notifier (that what it's for) still keeps poppin' up.
Here's my maki, what do I do wrong..?
//System.onScriptLoaded() section
onoff = eq.getObject("notifieronoff");
alwaysselector = eq.getObject("alwaysselector");
onoff2 = eq.getObject("notifieronoff2");
alwaysselector2 = eq.getObject("alwaysselector2");
if(getPrivateInt("AudioRack", "notifieronoff", on) == 1) {on = 1;}
if(getPrivateInt("AudioRack", "notifieronoff", on) != 1) {on = 0;}
if(on == 1) {onoff.setActivated(1); onoff2.setActivated(1);}
if(on == 0) {onoff.setActivated(0); onoff2.setActivated(0);}
if(getPrivateInt("AudioRack", "minimizedonly", always) == 1) {always = 1;}
if(getPrivateInt("AudioRack", "minimizedonly", always) != 1) {always = 0;}
if(always == 1) {alwaysselector.setActivated(1); alwaysselector2.setActivated(1);}
if(always == 0) {alwaysselector.setActivated(0); alwaysselector2.setActivated(0);}
}
Onoff.onLeftButtonUp(int x, int y) {
on = onoff.getActivated();
onoff2.setActivated(on);
}
Onoff2.onLeftButtonUp(int x, int y) {
onoff.leftClick();
}
Alwaysselector.onLeftButtonUp(int x, int y) {
always = alwaysselector.getActivated();
alwaysselector2.setActivated(always);
}
Alwaysselector2.onLeftButtonUp(int x, int y) {
alwaysselector.leftClick();
}