primadog
07-17-2002, 05:50 PM
I am trying to move a span with the pixelX and pixelY style using window.event.KeyCode for l, r, u, d
but for some reason the code won't work
<html>
<head>
<script SRC="source.js">
</script>
</head>
<BODY onkeypress="typeMe()">
<SPAN id=youCha style="position:absolute; left:100; top:200; width:300"><img src="archerA1.bmp"></SPAN>
<span id=Dra style="position:absolute; right:100; top:80; width:300"><img src="dragon.bmp"></span>
<span id=nameField style="position:absolute; left=50; top=400; width:300"></span>
</body>
</html>
----------------------
var input;
function typeMe() {
input = window.event.keyCode;
nameField.innerText = nameField.innerText + String.fromCharCode(window.event.keyCode);
if (input = 108)
youCha.style.pixelLeft -= 50;
if (input = 114)
youCha.style.pixelLeft += 50;
if (input = 106)
youCha.style.pixelTop -= 50;
if (input = 98)
youCha.style.pixelTop += 50;
}
can someone help me out?:confused:
Also, i need to know where can i dl a free software that allows me to turn bmp files to gif and animated gif files... (with transparent fuction)
but for some reason the code won't work
<html>
<head>
<script SRC="source.js">
</script>
</head>
<BODY onkeypress="typeMe()">
<SPAN id=youCha style="position:absolute; left:100; top:200; width:300"><img src="archerA1.bmp"></SPAN>
<span id=Dra style="position:absolute; right:100; top:80; width:300"><img src="dragon.bmp"></span>
<span id=nameField style="position:absolute; left=50; top=400; width:300"></span>
</body>
</html>
----------------------
var input;
function typeMe() {
input = window.event.keyCode;
nameField.innerText = nameField.innerText + String.fromCharCode(window.event.keyCode);
if (input = 108)
youCha.style.pixelLeft -= 50;
if (input = 114)
youCha.style.pixelLeft += 50;
if (input = 106)
youCha.style.pixelTop -= 50;
if (input = 98)
youCha.style.pixelTop += 50;
}
can someone help me out?:confused:
Also, i need to know where can i dl a free software that allows me to turn bmp files to gif and animated gif files... (with transparent fuction)