Forums > Javascript

retrive messages and attirbutes of js

October 8, 2006 | 8:04 am

hi, could someone please example a method to quary the getcmdlist from a javascript sketch object. i came across this:

function anything(){
// JKC’s code
//pass off all other messages to the wrapped Jitter Object
var a = arrayfromargs(arguments);

// detect if method or attribute and call method or set property accordingly
// methods are instances of the function class, detected with the isPrototypeOf method
if (Function.prototype.isPrototypeOf(mysketcher[messagename])) {
mysketcher[messagename](a);
}else{mysketcher[messagename] = a;}
}

and i understand that "you can assign values only to attributes of an object, whereas for messages you have to call a method of the same name."
like in:
textObject.text(hello, this is leiwand!);

textObject.font("Helvetica");

textObject.blend_enable = 1;

textObject.position = [-1.0, 0., 0.0];

but i cant get it to work. this is just for testing, i ultimatly want to use the capture, drawobject
to send gridshapes to sketch.
thnx


October 12, 2006 | 10:32 am

was this…
0, asked before
1, not nessecery
2, not available
3, cant be done
4, not a support priority
5, a thing to findout by oneself
6, below the radar
7, extensivly documented
8, to be found in the examples


October 27, 2006 | 7:51 am

Quote: yair r. wrote on Sun, 08 October 2006 02:04
—————————————————-
> hi, could someone please example a method to quary the getcmdlist from a javascript sketch object.

Has this been solved? I’m trying to troubleshoot a js with a command list and its driving me nuts.

THIS….

var staticSegs = null
var staticSegs = new JitterObject("jit.gl.sketch","ListenWindow");
staticSegs.getcmdlist();

yeilds this
? error: js: 4d.js: Javascript TypeError: staticSegs.getcmdlist is not a function, line 53


October 29, 2006 | 4:47 pm

Quote: yair r. wrote on Thu, 12 October 2006 12:32
—————————————————-
> was this…
> 0, asked before
> 1, not nessecery
> 2, not available
> 3, cant be done
> 4, not a support priority
> 5, a thing to findout by oneself
> 6, below the radar
> 7, extensivly documented
> 8, to be found in the examples
—————————————————-

That is really not a bad idea you know. What if we could choose to sign a contract and promise not to complain if the answer is just one of these numbers..? It would be really great to know what a silence means. But maybe you should add

9, we’re not sure and don’t feel like finding out at the moment

Not meant as joke, I’d find this a perfectly valid reply.

Mattijs


October 30, 2006 | 6:23 am

This would be great but it would require a spokesman for the swarm.

its a hazard.

http://www.edge.org/3rd_culture/lanier06/lanier06_index.html


October 30, 2006 | 10:21 am

Quote: Matthew Aidekman wrote on Mon, 30 October 2006 07:23
—————————————————-
> This would be great but it would require a spokesman for the swarm.

No, the priviledge of answering with these numbers would only be given to cycling 74 employees.


October 30, 2006 | 11:40 pm

Regardless of the proposed numerical system for all you digital
maoists out there, I thought I’d clarify the actual subject of this
thread. The original post method which parallels jsmoviebank-
example.pat, perfectly shows how to identify and distinguish between
methods and attributes of Jitter object as instantiated through JS.
The jit.gl.sketch getcmdlist *method*, unfortunately has no
"A_GIMMEBACK" variant to it (this is how a method is defined in C so
that there can be a return value in JS/Java), and is only useful from
a max patcher. We can consider changing this is a future version, but
it’s not high priority, so you’ll need to take other means of
managing your code and cmdlist.

-Joshua


December 13, 2006 | 1:29 pm

As a new user who is trying desperately to understand what I think could be described as passing (an) OpenGL command(s) to the jit.gl.sketch construct I came across this thread. It is the only one that I could find on the subject of using jit.gl.sketch. After having read the entire conversation I’m still lacking substantive information on the subject. What I find more puzzling is what you mean by the exchanges in this thread. I am here because of the terse response I got from an email posed to the technical support team of Cycling 74 suggesting that I should… well here, read it{

> Hi Keith,
> You will need to have a look at the documentation of the jit.gl.sketch object. Also, you should have a look at the JavaScript in Max document for info about using jit.gl.sketch within JavaScript. For more advice on this, please post questions to the Javascript dev forum.
}

Which, with the exception of appealing to this forum, I had already done…

I am hoping that it (the tenor of this thread) is offered as a joke. Without attempting in the least to be self congratulatory I would like to note my belief that we come into the world completly ignorant and remain so (to hopefully lessening but still measurable degrees) until we sign off of the planet. I find fondly appealing the idea that the notable distinguishing characteristic of humans is an ability to cooperate and communicate and in the process mutually improve their lot. When my learning curve with this software levels out and I can do more with it I look forward to helping out.


December 13, 2006 | 3:36 pm

Quote: keithcat wrote on Wed, 13 December 2006 14:29
—————————————————-
> > Hi Keith,
> > You will need to have a look at the documentation of the jit.gl.sketch object. Also, you should have a look at the JavaScript in Max document for info about using jit.gl.sketch within JavaScript. For more advice on this, please post questions to the Javascript dev forum.
> }
>
> Which, with the exception of appealing to this forum, I had already done…

In c74′s reply the help file of the object is not explicitly mentioned. Did you check it out? Especially in the case of jit.gl.sketch that would be a good move.

It is true that the procedure of gathering all information about a certain topic is to check a) the objects help files, b) the pdf documentation and c) a not-too-narrow forum search. It was quite confusing for me at the beginning.

Mattijs


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