Skip to main content
Participant
October 2, 2021
Question

Error: Syntax Error: Unexpected token else

  • October 2, 2021
  • 1 reply
  • 623 views

Hola soy nuevo en after effects y tengo un problema con esta expresión 


velocidad=1;
contadorInicial=TuDeslizador*60;

tiempoContador=Math.floor(contadorInicial - velocidad*time);

minutos=Math.floor(tiempoContador/60);
segundos=tiempoContador%60;
if (tiempoContador > 0 && time < tiempoContador){
Cero(minutos) + ":" + Cero(segundos);
} else ("00:00");

function Cero(n){
if(n<10) return "0" + n else return n;
}

 

siendo especifico en esta parte 

if(n<10) return "0" + n else return n;

mi after effects dice: Error: Syntax Error: Unexpected token else

 

This topic has been closed for replies.

1 reply

Mylenium
Legend
October 2, 2021

You are not using the correct brackets or for that matter not any brackets at all. All branching statemnts must be enclosed in curly brackets, not parentheses and those rules are even stricter when using the new engine. You really need to work on making your syntax cleaner.

 

Mylenium