I want to start a method of a JAVA applet using Javascript. It works fine for the APPLET tag (see below), but it doesn't work for the OBJECT (IE) or the EMBED (NN) tag.

<html>
<body>

<applet name="anApplet" code="anApplet.class">
</applet>

<script language="JavaScript">
document.anApplet.setText('SomeText')
</script>

</body>
</html>

Is something similar possible with the OBJECT and EMBED tag and how? Thanks in advance.