DropDown text that shows images | Help Optimizing Script
Like the title says, I have a dropdown box that shows stacked images when the text is called. All images are hidden until visible. Here is my code:
if (event.value == "Alto") {
this.getField("unit_info_type").value = "Mech";
this.getField("alto").display = display.visible;
this.getField("portanova").display = display.hidden;
this.getField("revernova").display = display.hidden;
} else if (event.value == "Portanova") {
this.getField("unit_info_type").value = "Mech";
this.getField("alto").display = display.hidden;
this.getField("portanova").display = display.visible;
this.getField("revernova").display = display.hidden;
} else if (event.value == "Revernova") {
this.getField("unit_info_type").value = "Mech";
this.getField("alto").display = display.hidden;
this.getField("portanova").display = display.hidden;
this.getField("revernova").display = display.visible;
} else {
this.getField("unit_info_type").value = "";
this.getField("alto").display = display.hidden;
this.getField("portanova").display = display.hidden;
this.getField("revernova").display = display.hidden;
}I have about 20+ more images I need to add so my questions is, how can I better clean this up?
