Hi guys,
I have a cool script made by Dave for updating text on a label button "POWER", I would like to update an image of another button "COLOUR" based on the text of the "POWER" label.
I tried with _getText.
Script like this
_getText('POWER'); {
if ('POWER', 'STANDBY'); {
return 'COULOUR[@]DirecTVRemote/round_amber_40px.png';
} else if ('POWER', 'ON'); {
return 'COULOUR[@]DirecTVRemote/round_red_40px.png';
}
}
i also tried with
_setImage('COLOUR', 'DirecTVRemote/round_red_40px.png');
but fail :p
Can someone help please ? thanx.
_getText !
Re: _getText !
I believe the script should look something like this:
var buttonText = _getText('POWER');
if (buttonText == 'STANDBY') {
return 'COULOUR[@]DirecTVRemote/round_amber_40px.png';
} else if (buttonText == 'ON') {
return 'COULOUR[@]DirecTVRemote/round_red_40px.png';
}
The _setImage script looks correct, you just need to ensure that the image name EXACTLY matches the name you provide, including upper/lower case, etc.
Hope this helps.
var buttonText = _getText('POWER');
if (buttonText == 'STANDBY') {
return 'COULOUR[@]DirecTVRemote/round_amber_40px.png';
} else if (buttonText == 'ON') {
return 'COULOUR[@]DirecTVRemote/round_red_40px.png';
}
The _setImage script looks correct, you just need to ensure that the image name EXACTLY matches the name you provide, including upper/lower case, etc.
Hope this helps.