Post 2 made on Saturday January 3, 2009 at 12:54 |
Rusty Fobe Long Time Member |
Joined: Posts: | December 2008 47 |
|
|
Hi Electroteam,
I cannot solve your problem as I am not knowledgeable enough yet in that matter, but I tried to simplify your programming. I did not test it with the simulator though. Other members, please correct me if I'm wrong, I'm a Javascript beginner.
Nested if's are complicated and difficult to read, so try to avoid them if you want to keep your code readable. Next, it is not always necessary to use if's to solve a logic. Since you standardized naming ("TV" and "TV+"), ("Speaker" and "Speaker+") and probably ("Yamaha" and "Yamaha+), you can simplify your code to a high extent:
onHold = function() { Vol=System.getGlobal("VOL"); LR=System.getGlobal("LR"); Zone=((LR=="Links")?"L":"R"); // if LR = "Links" then Zone="L" else Zone= "R"
{CF.widget(Vol+"+","Volume_Zone_"+Zone,"Script_Links").executeActions();} }; onHoldInterval = 30; // msec
Rusty
|
|
|