PDA

View Full Version : LzTimer repeat


rajs1
10-23-2004, 10:06 AM
I wonder if there is any way by which I can make the LzTimer repeat the delegate call after a set interval of time (for ever).

For example


LzTimer.addTimer( this.fadeDelegate, 3000 );

<method name="fadeText">
this.myText.animate( "opacity", 0.0, 1000 );
</method>


Seems to call fadeText just once.

I my case, I need to poll a servlet and receive XML data, say every 60 seconds, and update a corresponding grid.

I have done a search across all forums and there is not much to go on. Also the Reference for LzTimer does not suggest the availability of a repeat tag.

It does offer a restTimer but I do not know how to use that and if it would do the job.

Thanks.

Cheers
-raj

rajs1
10-24-2004, 03:20 AM
Following advise from looping lzTimer? (http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=964&highlight=LzTimer), I did the following:


<canvas>
<view name="dog" resource="doggie.png" clickable="true"
x="300" y="15">
<method event="onclick">
this.hereDel = new LzDelegate ( this, 'hereBoy' );
LzTimer.addTimer ( this.hereDel, 1500 );
</method>
<animator name="animdog" start="false" attribute="x" from="300" to="20" duration="1000" />
<method name="hereBoy">
animdog.doStart()
Debug.write(this.hereDel);
LzTimer.resetTimer(this.hereDel, 2000);
</method>
</view>
</canvas>


Any refinements to this code would be welcome.

Cheers
-raj