TIMER and CLS (animation problem)
Aug 8, 2018 8:08:51 GMT -5
Post by Gordon on Aug 8, 2018 8:08:51 GMT -5
Why does removing the REM stops the timer?
'raket en marslander
'call setCSS
'x= 320:y = 200
link #timer, "", [timer]
Call TimeoutLink 1000, "#timer"
wait
[timer]
'cls '<<<<<<<<< un-REM will stop the TIMER execution?
x = int(rnd(0)*500)+40
y = int(rnd(0)*400)+40
loadgraphic #fwin,"public\raket\marsla.png"
render #fwin
gosub [gifplaatjes]
'gosub [imgbuttons]
wait
[richting]
if EventKey$ = "#b3" and y>20 then y = y - 20
if EventKey$ = "#b2" and x<790 then x = x + 20
if EventKey$ = "#b1" and x>20 then x = x - 20
cls:render #fwin
gosub [gifplaatjes]
gosub [imgbuttons]
wait
'------------------------------------------
[gifplaatjes]
tp$ = " top:"+str$(y)+"px;"
lp$ = " left:"+str$(x)+"px;"
html "<img src='/raket/lande9.gif' style=' width:80px; height:80px; position:absolute;"+lp$+tp$+ "'>"
RETURN
[imgbuttons]
div nav1
imagebutton #b1, "\raket\links.jpg", [richting]
end div
div nav2
imagebutton #b2, "\raket\rechts.jpg", [richting]
end div
div nav3
imagebutton #b3, "\raket\omhoog.jpg", [richting]
end div
RETURN
Sub TimeoutLink msec, linkId$
html "
<script type=""text/javascript"">
<!--
var a = document.getElementById('"+linkId$+"');
if (a) window.setTimeout('window.location = a.href', "+Str$(msec)+");
//-->
</script>"
End Sub