XML Feeds

.

[javascript-dev] js disobeys law of cause and effect

evan.raskob [lists] lists at lowfrequency.org
Tue Nov 6 11:19:05 MST 2007


Hello,

I am banging my head against the wall with a very strange javascript  
problem.

I've always assumed that messages passed from a javascript outlet  
occur in the order I send them.  Apparently, this is not the case.

I have code to draw on jit.lcd automatically - it should move the pen  
to an initial spot ("moveto x y"), send a bang (so that the pen is  
updated), then get the dimensions of jit.lcd ("getdim").   I have a  
function "dim (x,y)" that should receive the jit.lcd dimensions, and  
in turn query it for the pen location (via the "getpenloc" message to  
jit.lcd).  I have a function in js called "penloc (x,y)" that should  
receive data from the jit.lcd telling me where the pen is located so  
i can continue drawing.  Sounds very simple, no? In reality, I run  
the code and see the message "getdim" which triggered the "getpenloc"  
message AT THE END of the output from the js object.  Which makes no  
sense, because getdim would have to be sent in order to trigger the  
drawing in the first place.  Also, the "clear" message to jit.lcd is  
executed LAST, even though it appears in the max window as having  
been sent in the proper order (FIRST).

In fact, the entire output seems absolutely arbitrary to me, with  
"getpenloc" calls all stacked in a row (or not at all).  I have tried  
using immediate mode to see if there is a difference, and tried  
adding and subtracting [deferlow] and [jit.qball] objects after both  
the jit.lcd and the js, but no hope.

Please help!



-Evan



More information about the javascript-dev mailing list