Switch Images according to a button's values
-
Hello Everyone, Can Anyone help me with switching the images of buttons from another button.
For now I'm able to switch the image but there is something wrong as it doesn't change the image unless I reload the project
I would appreciate if some can provide a snippet or an example that i go through and understand.
Thanks
inline function onDandLSwitchControl(component, value)
{
if(value){FXSlot2OnOff.set("filmstripImage", "{PROJECT_FOLDER}Layers_POWER_BUTTON_Yellow_72_X_144_X_2.png");
LightModeImage.showControl(false); DarkModeImage.showControl(true); }else{ FXSlot2OnOff.set("filmstripImage", "{PROJECT_FOLDER}MacroMacro_LightMode_POWER_BUTTON_Yellow_72_X_144_X_2.png"); LightModeImage.showControl(true); DarkModeImage.showControl(false); }
};
Content.getComponent("DandLSwitch").setControlCallback(onDandLSwitchControl);
-
You can't change these images dynamically. You'd need to have two different buttons for the two images and hide/show them as needed.
-
Thanks @d-healey