jsextensions and outlets
May 17 2014 | 6:04 pm
I need some help here. I have a (large) custom object that I want in the jsextensions. There are setters and getters in the object and the getters are supposed to go out an outlet. I came across this example of how to approach the outlet in the jsextensions folder:
function doit(myObject) { myObject.outlet(0,"bang"); }
So in my case I got something like this:
function MyObject() { this.self; this.setSelf = function(_self) { this.self = _self; } this.test = function () { this.self.outlet(0, "output this from my custom object to max…"); } }
In my js object I create my object like so and try and call the test function:
function bang() { var model = new MyObject(); model.setSelf(model); model.test(); }
Now my hope was that when I call model.test(), I would get something out my outlet, but all I get are error messages. Is there a way to do this? Eventually I am going to have a large number of these objects stored in an array, so sending the information directly from MyObject to the receiving part in Max is going to be crucial. Are there alternatives? Maybe I could send it to a receive object??
Any clues would be appreciated. I am stuck and can't see the forest for the trees!!
Thanks in advance