XML Feeds

.

[javascript-dev] another example of weird javascript crosstalk

Emmanuel Jourdan c74-mailinglists at e--j.com
Mon Jul 9 10:17:59 MDT 2007


On 9 juil. 07, at 17:57, Ivica Ico Bukvic wrote:

> Hi all,
>
> Here is an addendum to a problem I posted earlier on the maxmsp list.
>
> Symptom 1: multiple instances of the same abstraction (which  
> contains a js
> object for the purpose of creation dynamic number of audio outputs)  
> create
> objects ok when included in the same file (see poly_test.pat  
> below), their
> #0 argument is for some reason cross-polluted. So if we have a  
> "boo" and
> "bao" instance, both of them will be for some reason instantiated  
> as "boo"
> in this case.

The problem is that your name variable is not declared in your global  
code. So it becomes global to every instances of your js code. That  
is usually the problem when you see when 2 instances of the same js  
seems to share things.


> Symptom 2: matters are worse when using this in conjunction with  
> poly~ (see
> main.pat below) where sometimes instance 1 fails to create objects.  
> I tried
> rigging the code with Tasks to delay their execution within  
> javascript which
> for the most part minimizes failure to create objects, but  
> (depending on the
> time it takes to instantiate poly object, especially in the case of  
> more
> complex objects) its success rate is impossible to assess  
> consistently. I
> also tried using setname message which would be responsible for
> instantiating object's name via external message and that does not  
> work
> consistently either.

I couldn't reproduce that one. Next time if you can put an archive  
somewhere, that would be awesome ;-)

Cheers,
ej


More information about the javascript-dev mailing list