Forums > Javascript

tying flonums to javascript variables?

March 1, 2010 | 4:59 pm

Hi all,

I’ve run into an interesting issue with my latest patcher. I’ve got a bunch of Flonums that are acting as the readout for a large array in my JS. When the array changes, the JS updates the flonums. But I also want the flonums to be able to update the variables in the JS as well. Of course when I set it up like this it causes a feedback loop because the flonum updates the variable which updates the flonum, etc. How can I get around this? Ideally I’d like the flonum to act as if it IS the variable, so it updates when the variable updates and also updates the variable. I’ve been looking into the Pattr object as a possible answer to this but it doesn’t look like it can be tied to javascript variables, only to other objects. Can anybody suggest an elegant way to do this? Thanks!



Ch
March 1, 2010 | 7:57 pm

Hi,

Unless I misunderstood, the easiest way would be to put some "set $1" messages between your JS and the flonums.
Ch.


Viewing 2 posts - 1 through 2 (of 2 total)