danward79
September 11th, 2004, 09:35 AM
Hi
Does anyone know how to change the image in a button from the lua script file? What I need is to change the image between the active and inactive images.
I have been trying to do it using the State:Zone, in the ID Tag box, but it does not work.
Below is my LUA, it is the last bit with MP.Zone I need to get working to change the button state.
function OnVariableChange(varname,varvalue)
if (varname=="Marcel.WiFi.SignalStrength") then
marcel_setwifiimg();
elseif (varname=="weatherrefresh") then
NetRemote.SetVariable('weatherrefresh', '0');
NetRemote.ExecuteAction(-1,0,1,"NR.Checkweather");
elseif (varname == "cc.icon") then
iconnumber = tonumber(NetRemote.GetVariable("cc.icon"));
setweatherimg();
elseif (varname == "MP.Zone") then
MYZone = NetRemote.GetVariable("MP.Zone");
if (MYZone == "Main") then Zone = 1 else Zone = 0 end;
NetRemote.SetVariable('Zone', Zone);
end;
end;
If someone could shed somelight on this it would be great.
Thanks
Dan
Does anyone know how to change the image in a button from the lua script file? What I need is to change the image between the active and inactive images.
I have been trying to do it using the State:Zone, in the ID Tag box, but it does not work.
Below is my LUA, it is the last bit with MP.Zone I need to get working to change the button state.
function OnVariableChange(varname,varvalue)
if (varname=="Marcel.WiFi.SignalStrength") then
marcel_setwifiimg();
elseif (varname=="weatherrefresh") then
NetRemote.SetVariable('weatherrefresh', '0');
NetRemote.ExecuteAction(-1,0,1,"NR.Checkweather");
elseif (varname == "cc.icon") then
iconnumber = tonumber(NetRemote.GetVariable("cc.icon"));
setweatherimg();
elseif (varname == "MP.Zone") then
MYZone = NetRemote.GetVariable("MP.Zone");
if (MYZone == "Main") then Zone = 1 else Zone = 0 end;
NetRemote.SetVariable('Zone', Zone);
end;
end;
If someone could shed somelight on this it would be great.
Thanks
Dan