I am trying to send 2 commands to my camera, cmovert and cmovest. cmovert will start continuous movement to the right. cmovest will issue a stop command.
I would like to have onmouseover and onmouseout change my img, onmousedown to issue the cmovert command and onmouseup to issue the
cmovest command. In other words, I would like the camera to move right until the mouse is released.
This is what I am using now...
************************************************** ************************************************** ******
Expand|Select|Wrap|Line Numbers
- <!--
- // PRELOADING IMAGES
- if (document.images) {
- img2_on =new Image(); img2_on.src ="images/fingerrt2.gif"; img2_off=new Image(); img2_off.src="images/fingerrt1.gif";
- }
- function movr(k) {
- if (document.images)
- eval('document.img'+k+'.src=img'+k+'_on.src');
- }
- function mout(k) {
- if (document.images)
- eval('document.img'+k+'.src=img'+k+'_off.src');
- }
- //-->
onMouseOut="mout(2);return true;" onClick="return true;"><img name="img2" border="0"
width="48" height="27" alt="Move right" src="images/fingerrt1.gif"></a></td>[/HTML]
************************************************** ************************************************** *******
This will successfully change the image and issue the cmove commnd but there is no provision for the cmovest command.
I did some experimenting and tried this....
************************************************** ************************************************** *******
[HTML] <td align="left">
<a onmousedown="href='http://doofus1.mine.nu:3417/cmd=cmovert'" ;
a onmouseup="href='http://doofus1.mine.nu:3417/cmd=cmovest';return true;"
onMouseOver="movr(2);return true;"
onMouseOut="mout(2);return true;">
<img name="img2" border="0" width="48" height="27" alt="Move right" src="images/fingerrt1.gif"></a></td>
[/HTML]************************************************** ************************************************** **********
When I mousedown, I see on the status line...href='http://doofus1.mine.nu:3417/cmd=cmovert. If I mouseout and then mouseover again I
see...href='http://doofus1.mine.nu:3417/cmd=cmovest on the status line. After some further experimentation, I beleive that the
cmovest command is being issued but I have no evidence that cmovert was sent.
Any ideas how I can clean this up so that it works?
Any help would be appreciated.
Thanx