XML Feeds

.

[javascript-dev] Connect existing object to scripted one

Jeremy Bernstein jeremy at bootsquad.com
Sun Jun 10 11:47:37 MDT 2007


Try this:

inlets = 1;
outlets = 0;

var theunpack = 0;
var thedata = this.patcher.getnamed('thedata');

function bang()
{
    if (theunpack)
    {
       this.patcher.remove(theunpack);
    }
    theunpack = this.patcher.newdefault(200, 200, 'unpack', 0, 0);
    this.patcher.connect(thedata, 0, theunpack, 0);
}

Now, if that works, and it should (although I haven't tested it), it  
should be clear what the problem was. What was it?

jb


Am 10.06.2007 um 19:37 schrieb Frans-Jan Wind:

> The .js file "dataToGen.js"
> inlets  = 1;
> outlets  = 0;
>
> var theunpack;
> //var thedata = this.patcher.thedata;
>
> function bang()
> {
> 	if( theunpack )
> 	{
> 		this.patcher.remove( theunpack );
> 	}
> 	theunpack = this.patcher.newdefault( 200, 200, 'unpack', 0, 0);
> 	this.patcher.connect( thedata, 0, theunpack, 0 );
> }



More information about the javascript-dev mailing list