...

View Full Version : html communicate with applet in js file



tommo77funk
10-07-2008, 10:53 PM
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

rangana
10-08-2008, 02:28 AM
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.

tommo77funk
10-08-2008, 10:14 AM
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

rangana
10-08-2008, 10:45 AM
What's a pano? Which part of the page is that?

tommo77funk
10-08-2008, 11:21 AM
Hi,


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


cheers !

tom

rangana
10-09-2008, 01:49 AM
I'm sorry, but I'm on my wits end.

tommo77funk
10-09-2008, 03:20 AM
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/troubleshooter/activate-embedded-object.html

many thanks,

tom



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum