Sending a message to a newdefault

Anthony Palomba's icon

Hey folks,

I have created a Max object using "newdefault" from my javascript. I want to then send a message to this new object. I am using the following function...

maxObj.message(“list”, "test message");

This seems to generate a script error. How do I send a MaxObject a message?
Is there a way I can specify a inlet number as well?

Anthony

Emmanuel Jourdan's icon

how about maxObj.message(“test", "message”)? A list should start by a number.

Anthony Palomba's icon

Hey Emmanuel, thanks for our response. I tried your suggestion, it compiles fine but I get the following error...

patcher: doesn't understand "test"

The patcher I instantiated with "newdefault" is an abstraction of my own. Can I send the message to an inlet instead so that I can handle the message in my abstraction?

Emmanuel Jourdan's icon

Patcher are special…

This is not pretty but you can do something like this.

Archive1.zip
zip
Anthony Palomba's icon

Ugh, not pretty at all...

So are you saying there is no way to send a user defined message to a MaxObj via javascript?

Emmanuel Jourdan's icon

No you can send a message to MaxObject but not to a patcher ;-)

Archive2.zip
zip
Anthony Palomba's icon

I see, I seem to be confusing an abstraction with an object. Will have to think about this some more.