Previous Next Index Thread

[Fwd: Cosmo External Interface]

I don't know why this was in my mailbox this morning!
-- BEGIN included message.

I am trying to use Java to interact with VRML nodes. I am
using Cosmo Player 1.0b3, and their interface requires
getting a reference to the browser from within Java
code. All the samples I can find use the following:

    JSObject win = JSObject.getWindow(this);
    JSObject doc = (JSObject) win.getMember("document");
    JSObject embeds = (JSObject) doc.getMember("embeds");
    browser = (Browser) embeds.getSlot(0);

I don't think this Java code is specific to Cosmo, but
it is specific to Netscape (>3.0). However, every time
I try this I get this error:

java.lang.classCastException: vrml.external.Browser

It seems that the value returned from "embeds.getSlot(0)"
cannot be legally cast to the Browser class. Has anyone
else experienced this problem? Or has anyone had success
with the above code snippet? Please let me know.

Thank you,
Ginnie Games
Software Developer
NRaD

-------------------------------------------------------------------
*** Please send administrative requests to <majordomo@sdsc.edu> ***
-------------------------------------------------------------------

-- END included message