Could anyone tell me why this code does not work as intended. It sticks at the
first frame. If I assign any other frame numbers to j then that frame is
displayed.

<canvas debug="true" width="100%" height="100%">
<resource name="face">
    <frame src="banner.png"/>
    <frame src="crab"/>
    <frame src="crab2"/>
  </resource>
<view x="150" y="50" resource="face" name="myview"/>

<handler name="oninit"><![CDATA[
var j=1
var t
var p = myview.totalframes
var speed = 1000
loadandfade()

function loadandfade(){


    myview.setAttribute("frame",j)
    j = j + 1
    if (j > (p-1)) j=1
    t = setTimeout('loadandfade()', speed)


     }

]]>
</handler>

</canvas>

Kind Regards
Garry

Reply via email to