rectangle coords
Hii, looking for some advice..If i send in an array, could i dynamically set the coordinates of this rectangle? Im just hacking at this so any advice is appeciated.Im still new to js so graphics is a bit of leaning curve.Thanks

Im aiming to run some loops, and sequnce some trails genrally just curious.
Id have to write the array first and generate var values, can i input the array/list through a message?
Yes. I'd probably just store the rect coords as an array outside your paint function. Set the values using some function like:
// This is a pretty bad function but you should get the idea?
function setrect() {
rect = [ arguments[0], arguments[1], arguments[2], arguments[3] ]
mgraphics.redraw()
}
FWIW There's an excellent set of 30 example patches for mgraphics usage. I wish this were easier to find on the site: https://cycling74.com/tutorials/november-patch-a-day
id like to set var
w = setrect[0]; //etc.. and then assign them some how ? like
rect = w, x, y, z
i thought i had to use list() or anything() so i can input a list with a symbol as a function name?
okeyyy awesome setrect is woriking..always thought anything() was the only way
Thanks Tyler pretty awesome, very basic.be cool to add mouse drag..
Glad it helped. You mean ondrag()? https://docs.cycling74.com/max8/vignettes/jsuiobject
Yeh im working toward that thanks also thanks for the link to the other references they will be a huge help.
what about setTimeout?
function newcolor(){ setTimeout (setrect, 1000, arguments[0] = random(), arguments[1] = random(), arguments[2] = random() );
I'd start another thread to get better chance of more responses (since setTimeout is tangential to the initial question here). But I don't think it's available in JS in Max and you need to use the Task object. Would love to be proved wrong on that.
ok, ill see what the community says.
post is here Ill check out Task now