getting started with javascript
in
Processing with Other Languages
•
1 month ago
Hi
I'm trying to start using javascript to code sketches with user interfaces on the web (ok, it is a game). I have no experience in networks so i just tried simple examples from the books of Reas-Freys, but I can't make them work. I tried the following code:
The result is that "test" is only displayed once and firefox console displays
[07:39:24,327] uncaught exception: Processing.js: Unable to execute pjs sketch: ReferenceError: Server is not defined
Also the sketch log displays "Server started: http://127.0.0.1:59095", which is clearly not 5204 (i tried other ports).
Where is the goofy mistake?
I'm trying to start using javascript to code sketches with user interfaces on the web (ok, it is a game). I have no experience in networks so i just tried simple examples from the books of Reas-Freys, but I can't make them work. I tried the following code:
import processing.net.*;
Server server;
void setup() {
size(400, 200);
println("test");
server = new Server(this, 5204);
}
void draw() {
background(255);
println("test");
Client client = server.available();
}
The result is that "test" is only displayed once and firefox console displays
[07:39:24,327] uncaught exception: Processing.js: Unable to execute pjs sketch: ReferenceError: Server is not defined
Also the sketch log displays "Server started: http://127.0.0.1:59095", which is clearly not 5204 (i tried other ports).
Where is the goofy mistake?
1