Accessing properties of an applet

by Doug Miles <douglas_miles(at)yahoo.com>

 Date:  Mon, 18 Sep 2000 17:38:22 -0500
 To:  HWG Languages <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hi,

I have an applet that was supplied by my customer that has a property which 
I want to interrogate using VB Script or JavaScript.  I've never worked 
with a Java applet before, and I'm working blind here.  I can declare the 
applet in my HTML, but I don't know how to reference the 'query' property.

 From what I can tell, the property is declared as public within the java 
class:
      ...
      public class DoesPlayerExist extends Applet{
	
	private boolean bRunningOnIE = false;
	...
	public void init(){}

	public boolean query(){
		start();
		return IsPlayerInstalled;
	}
      ...

The applet declaration (in the head section) looks like:
      <.applet code="DoesPlayerExist" id="PlayerExist" width="100" 
height="100" codebase="../plugins">
        <.param name="cabinets" value="DoesPlayerExist.cab">
      <./applet>

But I've also tried:
      <.object width=100 height=100 id="PlayerExist" codebase="../plugins" 
type="application/x-oleobject">
        <.param name="cabinets" value="DoesPlayerExist.cab">
      <./object>

The vbscript in the body looks like:
      <.script language="VBScript">
        If PlayerExist.query() Then
          document.writeln "You have the player installed."
        else
          document.writeln "You <b>don't</b> have the player installed."
        end if
      <./script>

When I open the page, I get the error "Error: Object doesn't support this 
property or method: 'PlayerExist.query' " on the line that reads "If 
PlayerExist.query() Then"

How should I be interrogating the property?  Or am I instantiating the 
object wrong?

Any help is greatly appreciated!

--Doug


_________________________________________________________
Do You Yahoo!?
Get your free (at)yahoo.com address at http://mail.yahoo.com

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA