Copy link to clipboard
Copied
I actually have this but i dont know why my function is wrong when the text input have the correct pass "hola" here is my code:
//AQUÍ EMPIEZA A CREARSE LA VENTANA DEL PANEL
{
function myScript(thisObj){
function myScript_buildUI(thisObj){
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Panel Estudio Voraz",undefined,{resizable:true},{borderless:false});
myPanel.layout.resize();
res = "group{orientation:'column',margins: 0, spacing: 0,\
grp3: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\
alignChildren:['center','fill'],\
textInput: EditText{text:'',minimumSize:[150,10],properties:{noecho:true}},\
},\
grp4: Panel{type:'panel',text:'Patterns',orientation:'column',margins: [4,9,4,5], spacing: 1,\
alignChildren:['center','fill'],\
btn: Button{text:'Comprobar',minimumSize:[150,10],properties:{noecho:false}},\
},\
}";
myPanel.grp = myPanel.add(res);
var pass = myPanel.grp.grp3.textInput.text
myPanel.grp.grp4.btn.onClick = function (){
if(pass == 'hola'){
alert("TRUE");
}
else(pass != 'hola'){
alert("FALSE");
}
}
//FUNCION QUE DETECTA TODOS LOS PROJECT ITEM Y EN LUGAR DE ASIGNARLE UN NÚMERO DEL INDEX LO DETECTA POR SU NOMBRE
function projectItem(name)
{
var items = app.project.items;
i = 1;
while (i <= items.length) {
if (items.name == name)
{
return app.project.item(i);
break;
}
i++;
}
}
I don't think you need the "(pass != 'hola')" after the "else" on 33. Not only is that incorrect JavaScript syntax, but your "if" condition already accounts for this. If you really want to keep it, I would write line 33 as "else if (pass != 'hola')"
Copy link to clipboard
Copied
I don't think you need the "(pass != 'hola')" after the "else" on 33. Not only is that incorrect JavaScript syntax, but your "if" condition already accounts for this. If you really want to keep it, I would write line 33 as "else if (pass != 'hola')"
Copy link to clipboard
Copied
Thank you i actually got it.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now