Skip to main content
JesB-SsPV8V
Inspiring
October 18, 2013
Answered

My script suddenly stops?

  • October 18, 2013
  • 1 reply
  • 5308 views

Hi everyone!

Does anyone know what the reason why my script suddenly stops?

Sometimes when I'm working with the script, the script stops, and I will have to either restart AE or the script (it is a GUI script, which is saved as a .jsxbin). Sometimes there is also a message saying that the code is wrong on line 76, but I have gone through the code 100 times and can not find anything wrong.

This topic has been closed for replies.
Correct answer JesB-SsPV8V

Well by just using var keyword before it will make the var local to that function, or to use a different variable name.

However, I don't think anybody can really help you here until you are using the ESTK and report at what line it stops and what

the error code is.


Hi everyone!

Found out what the error was, and I have fixed it. The error was that my variables was putted after the else{} function. However when I moved these before the else{} function everything worked perfect.

Anyway thanks for all the help. I am very grateful!

1 reply

Legend
October 18, 2013

Clearly, something is wrong on or around line 76.  Can you not build the script directly from ESTK targeting AE, set a breakpoint before 76 and then examine what's going on with your vars' data in the Data browser?  You need to debug the code while the script is running directly out of ESTK.

Also, what do you mean by "I have gone through the code 100 times and can not find anything wrong"?  Does that mean you have already tried debugging, or are you simply re-reading your code?  Can you shed some light on your debugging process?

--Arie

JesB-SsPV8V
Inspiring
October 18, 2013

Thanks for the quick reply Arie!

What I mean is that I have re-read my code many times, but haven't figured out what the error is.

I'm pretty new to AE scripting so have never tried "debugging process". I'm not quite sure what it is (to be honest).

The code at line 76:

addParallel.onClick = function(){

            addParallel = proj.layers.addLight("Parallel Light", [960, 540]);

            addParallel.lightType = LightType.PARALLEL;

            addParallel.property("position").setValue([ 1040, 460, -666.6667]);

            }

Mainly what happen is that the script work a bit, and then it stops. When I then reload the script. I get an error message saying: "Unable to execute script at line 76 undefined is not an object ".

Dan Ebberts
Community Expert
Community Expert
October 18, 2013

Is "proj" defined somewhere? It looks suspiciously like you're trying to add your light to the project rather than to a comp.

Dan