Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post

    html communicate with applet in js file

    Hi,

    I am hoping some kind soul can enlighten me on how to communicate with an applet when it is put in a .js file.

    I was trying to get rid off the annoying "click to activate this control" (viewed with I.E.) so i moved the applet from my html page to a seperate js file and used document.write etc.

    The problem now is that all the js functions i had in my html to communicate with the applet dont work.

    My .js file is called my_applet.js and in my html i have the following function

    //head
    <script type="text/javascript">

    flip=false;off="Start";on="Stop"
    flip=false;on="Stop";off="Start";
    function toggle(pn){
    p=parseInt(pn,10);
    if(flip){

    document.player.execpano("set(\"sfxRai\",\"visible\",false)")

    }else{

    document.player.execpano("set(\"sfxRai\",\"visible\",true)")

    }
    flip=!flip;
    }
    </script>

    //body
    <input type="image" src="images/73.gif" onclick="toggle('0')" value="rain" />

    I tried putting all my js functions in with the applet in the js file (preferred option) but it did'nt work.

    I have been searching forums for a couple of days and have an idea that it may be something to do with getting the document id but am not sure.

    I Would be really grateful for any advice.

    Best wishes and many thanks,

    tom

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    If your main problem was that annoying yello bar (ActiveX Warning) on IE, then you should'nt worry that much as it only happens offline and not when your page is uploaded on the server.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hi,

    Thanks for the reply, but the I.E. active x warning is currently displaying on my uploaded page on the server.

    have a look http://www.vrwebdesign.co.uk/virtualtourprogramming.htm put your cursor over the pano, can you see the the yellow i.e. bar ? well this is what i'm trying to get rid off and can, by putting applet in js file but then i loose functionality of the buttons i made for the pano on my html page, unless i can find some code that helps to communicate with my applet in the js file. It must be possible but hunting on the web and forums i am not finding any solutions.

    any ideas ?

    here is my_applet.js

    document.write('<APPLET archive="PurePlayerPro.jar" code="PurePlayerPro" width="600" height="400" >');
    document.write('<param name="panorama" value="pano1.ivp">');
    document.write('<param name="gui" value="gui.ivu">');
    document.write('<param name="singlepanorama" value="true">');
    document.write('<param name="optimizememory" value="true">');
    document.write('<param name="transition" value="TransBlend">');
    document.write('</APPLET>');


    and here is the button in html

    <input type="image" src="images/73.gif" onclick="toggle('0')" value="rain" />


    and here is the command



    function toggle(pn){
    p=parseInt(pn,10);
    if(flip){

    document.player.execpano("set(\"sfxRai\",\"visible\",false)")

    }else{

    document.player.execpano("set(\"sfxRai\",\"visible\",true)")

    }
    flip=!flip;
    }



    What i need i think is for the applet to have an id, then i can refer to that id in the html file and send commands to the js file, i think but am not sure which is why i'm on this forum.

    Many thanks and best wishes,


    tom
    Last edited by tommo77funk; 10-08-2008 at 11:16 AM.

  • #4
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    What's a pano? Which part of the page is that?
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #5
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    Hi,


    Sorry pano means panorama, the interactive thing in the middle under the header.


    cheers !

    tom

  • #6
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    I'm sorry, but I'm on my wits end.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #7
    New Coder
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    1
    Thanked 1 Time in 1 Post
    hi rangana,

    Many thanks for taking the time. I am sorry my terminology is a bit brief, please let me know if there is something you do not understand.

    I think i might have to write a variable with the applet's id then use getElementById in the html to send commends to the js file.

    I will keep trying, I basically did this tutorial

    http://www.mediacollege.com/internet...ed-object.html

    many thanks,

    tom


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •