FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   applet and javascript
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: applet and javascript  (Read 359 times)
eskimoblood

222550793222550793 WWW
applet and javascript
« on: Jan 5th, 2005, 3:00pm »

I try do call a methode in the applet via javascript.
 
These is the code of my applet:
 
Code:

int cnt=0;
void setup(){
  size(700,300);
  textFont(loadFont("Trebuchet_MS.vlw"));
}
 
public void test(){
cnt++;
background(25);
fill(0);
text(cnt,20,20);
}

These is my javascript function:
Code:

function click() {
document.theApplet.test();
}

But whenever I call the javascript these error appears:
 
document.theApplet.test is not a function
« Last Edit: Jan 5th, 2005, 3:02pm by eskimoblood »  
fjen

WWW
Re: applet and javascript
« Reply #1 on: Jan 5th, 2005, 4:56pm »

i only got it to work when the name of the applet is equal to the class-name:
 
<applet name="abc" class="abc" archive="abc.jar" ...
 
see here:
http://www.florianjenett.de/p55/js_example/
 
sadly i still can't see your applets with safari ...
 
good luck!
/F
 
eskimoblood

222550793222550793 WWW
Re: applet and javascript
« Reply #2 on: Jan 6th, 2005, 11:20am »

Thanks. The name tag was it.
 
liminal


Re: applet and javascript
« Reply #3 on: Jan 6th, 2005, 8:20pm »

There is info on scripting with the java plug-in available here:
 
http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/js_java .html
 
That won't work with the standard MS IE 1.1 VM, and I don't know what the situation is for mac.
 
Pages: 1 

« Previous topic | Next topic »