-
Reloading the “Create UI” code
Sorry for my English, is not my native tongue.
I’m creating an UI of a script using functions and conditionals, so depending on what I select from the menu (dropdownlist), the UI I’ll see.
However, once the interface is created, the script only adds the new UI on top the previous.
Is there a way to tell After Effects that you want to reload the “return window” of the main function that’s creating the main UI, so it only creates the “window.add” that conditionals are describing, and make dissapear the interfaces it added before?Thanks!
Matz
function createUI(thisObj)
{
var ventana = (thisObj instanceof Panel) ? thisObj : new Window(“palette”, “mi Script”, [100, 100, 300, 300], {resizeable:true});ventana.add(“statictext”,[10, 10, 90, 30],”Tool”);
var toolMenu=ventana.add(“dropdownlist”,[100, 10, 195, 30],[“A”,”B”,”C”,”D”,”E”]);
toolMenu.selection=1;toolMenu.onChange=function fcreateUIS(){
var toolSelection = toolMenu.selection.index;
//EMPIEZA EL CREADOR DE INTERFACES
if(toolSelection==0){
ventana.add(“statictext”,[10, 40, 90, 60], “A TOOL”);
ventana.add(“edittext”,[100,40,180,60],”Sin Nombre”);
};
if(toolSelection==1){
ventana.add(“statictext”,[10, 40, 90, 60], “B TOOL”);
ventana.add(“edittext”,[100,40,180,60],”Sin Nombre”);
};};
//TERMINA EL CREADOR DE INTERFACESreturn(ventana);
}var pal = createUI(this);
pal;