View Full Version : LzTimer executing delegate early
cmcginnis
12-08-2003, 06:13 PM
Hello
I have an application right now where I set a LzTimer on a delegate to execute it in two minutes (120000 millis), then request and process some data from a http dataset.
The delegate is actually getting executed after 30 seconds (30000 millis). Any idea what is going on? Have you heard about anybody else having this problem?
Thanks in advance
cmcginnis
12-08-2003, 06:33 PM
Here is a little test application - notice that the lzTimer is being set with 60 seconds and the debug comes out after 30 seconds.
<canvas debug="true">
<dataset name="mydata" autorequest="false" src="http://localhost:8080/timerdata.jsp"/>
<view name="myView" id="myView">
<attribute name="debugDel" init="new LzDelegate( this, 'writeDebug' )"/>
<view name="names">
<text name="stuffFromData" datapath="mydata:/names/name/text()"/>
<simplelayout axis="y" spacing="5"/>
</view>
<button name="getData" onclick="myView.getTheData()">Get The Data</button>
<simplelayout axis="y" spacing="5"/>
<method name="getTheData">
LzTimer.addTimer( this.debugDel, 60000 );
mydata.doRequest();
</method>
<method name="writeDebug">Debug.write("How much time passed?");</method>
</view>
</canvas>
Here is the JSP:
<%@ page contentType="text/xml" %>
<% System.out.println("Getting the names..."); %>
<names>
<name>Bob</name>
<name>Fred</name>
<name>JoAnne</name>
<name>Antun</name>
</names>
antun
12-09-2003, 08:12 AM
Hi Chris
I just tested this, and it worked fine. Your example had the timer set to 60s, but I tried increasing it to 120s.
Just to be clear on this point:
<method name="getTheData">
LzTimer.addTimer( this.debugDel, 120000 );
mydata.doRequest();
</method>
The doRequest() line is not going to wait until the the timer has finished before it executes - the timer will start, and immediately following that, the request will be made. If you want to wait for two minutes before you make the request then you'll need to put the doRequest() line in the method that gets called by the debugDel delegate (i.e. writeDebug).
-Antun
cmcginnis
12-09-2003, 10:00 AM
I'm trying this using v1 production.
I am not trying to wait until the the timer has expired to call the do request. The timer seems to work as long as the time limit is 30 seconds or under. If I set to to higher than that it still executes in only 30 seconds.
If I comment out the doRequest line in the code above it works fine.
Any other ideas?
Thanks
antun
12-09-2003, 10:05 AM
Like I said, it worked fine for me (I tried both one and two minute delays).
What Flash player version are you testing on?
-Antun
cmcginnis
12-09-2003, 10:08 AM
Using flash player 7
antun
12-09-2003, 10:16 AM
Same here - I'm using Flash 7 too. What version of the LPS are you on?
-Antun
cmcginnis
12-09-2003, 10:42 AM
LPS v1.0.1
antun
12-09-2003, 04:20 PM
Are you sure you're not seeing a cached version of your app or something? I've been trying to replicate this, with no luck.
Have you cleared your browser and LPS server cache?
I've tested both one and two minute delays on LPS v1.0.1 and 1.0.2, on Flash Players 6 and 7.
-Antun
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.