60 seconds
times
30 minutes
times
1000 miliseconds
equals
1800000
I recommend using "60 * 30 * 1000" instead of the "1800000" so it's easier for you to change/debug
and then just add an event listener on "timer" event name along with the function you want it to call upon 30 minutes and then your done :p
On 05/08/06,
David Brown <[EMAIL PROTECTED]> wrote:
Hello all,I could use some help. I have been livedocs.macromedia.com/flex/2docs looking for a way to create a timer function that would execute a function every 30 min. I found an example of mytimer and looked at a example for simple analog clock. But I am having a hard time understanding how it relates to my code. Below is a code snipet.I would like to run the InitApp() function every 30 min. That should refresh my two datagrids that inturn will update my screen.Any help would be great.ThankDavidmx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="500" height="56" backgroundGradientColors="[#ffffff, #ffffff]" creationComplete="initVars()" horizontalAlign="center" verticalAlign="middle" borderColor="#ff0000" backgroundColor="#ffffff" borderStyle="solid" borderThickness="1">
<mx:Script>
<![CDATA[
import mx.logging.LogEvent;
/* import flash.events.MouseEvent;
import mx.events.FlexEvent; */
import mx.styles.CSSStyleDeclaration;
import mx.effects.*;
import mx.events.*;
import mx.rpc.events.*;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
import mx.controls.Alert;
import mx.collections.*;
import flash.net.*;
import flash.display.Sprite;
[Bindable]
public var mylocID:String;// Assign values to new properties.
private function initVars():void {
InitApp();
}
public function InitApp():void
{
// assign values passed from the html object flashvars
mylocID = Application.application.parameters.mylocID;
// if no value passed from the html object tag then assign value
if (mylocID == null) {
mylocID = "29223";
}
// get weather
weatherSvc.qryCurrentWeather(mylocID);
weatherSvc.qryExtendedWeather(mylocID);
// set focus on the first row of the grids
dgCurrentWeather.selectedIndex = 0;
dgExtendedWeather.selectedIndex = 0;
}
]]>
</mx:Script>
<mx:RemoteObject id="weatherSvc" destination="ColdFusion" source="Widgets.cfc.widgets" showBusyCursor="true" />
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
![]()
SPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- Re: [flexcoders] Timer to run function every 30 min sinatosk
- Re: [flexcoders] Timer to run function every 30 min Jeremy Lu
- Re: [flexcoders] Timer to run function every 30 min David Brown
- [flexcoders] Re: Timer to run function every 30 ... richmcgillicuddy
- [flexcoders] Re: Timer to run function every 30 ... David Brown
Reply via email to

