I’ve got an applet ( see below) embedded in in my html page using the gearsapplet as a template. I have an ID field in the applet tag ID=“Anatomy”.
The applet runs fine. So far so good… Now I’m trying to get communication between the applet and the browser host going and have run into a brick wall.
I’m trying to call setHide() from javascript like this document.Anatomy.setHide(parseInt(display));
But I get a javascript error ‘Object doesn’t support this property or method’
However I can call the stop() method quite happily.
Could someone point out my fault.
Thanks. Chris
import java.applet.;
import java.awt.;
import java.io.*;
import javax.media.opengl.;
import com.sun.opengl.util.;
import realTime.anatomy.anatomy;
/** Shows how to deploy an applet using JOGL. This demo must be
referenced from a web page via an <applet> tag. */
public class AnatomyApplet extends Applet {
private Animator animator;
anatomy flesh = new anatomy();
public void init() {
setLayout(new BorderLayout());
GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(flesh);
canvas.setSize(getSize());
add(canvas, BorderLayout.CENTER);
animator = new FPSAnimator(canvas, 60);
}
public void start() {
animator.start();
}
public void stop() {
System.err.println(“stop called”);
// FIXME: do I need to do anything else here?
animator.stop();
}
public void setHide(int n){
System.err.println(“hide called”);
flesh.hide( n );
}
public void setShow(int n ){
System.err.println(“show called”);
flesh.show( n );
}
}