Forums > Javascript

creating a message box

March 30, 2009 | 2:19 pm

i can create a message box but how do i set it’s contents ? i can send it a set message but how do i do it during its creation ala newdefault.

when i set with a set message i get double quotes, how do i get rid of these?

robin xx


March 30, 2009 | 2:26 pm

I got rid of the quotes, still wondering how to set a message box’s contents on creation.


March 30, 2009 | 4:17 pm

Please post an example of what you’re currently doing.


March 30, 2009 | 6:55 pm

Try something like these examples, the first one is like sending a message to [thispatcher] and the other uses newdefault

var myobj = this.patcher.message("script","newobject","message","@text","hello");
var myobj = this.patcher.newdefault(300,400,"message","@text","hello");

lh


March 30, 2009 | 7:29 pm

cheers lh, that’s what i was looking for


April 1, 2009 | 10:57 pm

I’m having a hard time figuring out how do make messages like "rate $1".

Obviously, these don’t work for me:

function makemess(){
var mess1 = this.patcher.newdefault(50,150,"message", "@text", "rate $1");
var mess1 = this.patcher.newdefault(50,200,"message", "@text", "rate", "$1");

Help will be appreciated.


April 2, 2009 | 12:34 am

var myobj = this.patcher.message("script", "newobject", "message", "@text", "rate $1"); should work for you.

lh


April 2, 2009 | 7:06 am

Yes, it does, thank you. Wonder why the newdefault method doesn’t work like this, though. I know I had it working that way also, at one point, but then I broke it when I rewrote some code yesterday.


April 2, 2009 | 10:11 am

@lut lei I had that problem with new default too. Thanks lh


April 2, 2009 | 10:43 am

I guess using newdefault have few advantages over newobject, when it comes to messageboxes, anyway.


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