Re: [flexcoders] scheduled functions
Am Montag, 18. Dezember 2006 22:00 schrieb Gordon Smith: You could do this using the Timer class in the flash.utils package. I'd create a Timer that fires once a minute, determines the clock time, and checks to see if there are any alarms to display. Gordon, I do something similar in my model to set (create) the current time for a desktop application. The application displays a running clock. Below are the relevant snippets from my model class: [...] private var timer:Timer = new Timer(100, 0); public var now:Date = new Date(); [...] timer.addEventListener(timer, timerHandler); timer.start(); [...] private function timerHandler(timerEvent:TimerEvent):void { now = new Date(); } On Mac OS X the clock is always one second *ahead* (compared to the displayed time in the system panel under date/time). Is there a better way? tia, O. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] scheduled functions
Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark
RE: [flexcoders] scheduled functions
You could do this using the Timer class in the flash.utils package. I'd create a Timer that fires once a minute, determines the clock time, and checks to see if there are any alarms to display. The Flash Player doesn't have multiple threads. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 12:46 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] scheduled functions Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark
RE: [flexcoders] scheduled functions
Start a Timer() when the application loads with it's delay property from the time the app starts till the time you wish to fire an event. For example the app starts at 8:00 am, and you want to show a pop up at 5pm to remind the user to go home, You just take the difference in time which is 9h and turn that into milliseconds and set your Timer.delay = the time difference. ( the delay is the time between firing events, so you could set it to every hour if you wanted to show a pop up every hour ) Then, register an event handler for Timer.timer or Timer.timerComplete events that accept a TimerEvent And there you go. When the Timer is complete it'll fire an event to your handler which then displays your popup. Look in the Timer, TimerEvent classes B.. -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 1:46 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] scheduled functions Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***
Re: [flexcoders] scheduled functions
Awesome!!! that's exactly what i needed. I was searching for the wrong words :) Thanks! On Dec 18, 2006, at 4:00 PM, Gordon Smith wrote: You could do this using the Timer class in the flash.utils package. I'd create a Timer that fires once a minute, determines the clock time, and checks to see if there are any alarms to display. The Flash Player doesn't have multiple threads. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 12:46 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] scheduled functions Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark
RE: [flexcoders] scheduled functions
Here is a time-out example: http://www.cflex.net/showfiledetails.cfm?ChannelID=1Object=FileobjectI D=578 Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 4:12 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] scheduled functions Awesome!!! that's exactly what i needed. I was searching for the wrong words :) Thanks! On Dec 18, 2006, at 4:00 PM, Gordon Smith wrote: You could do this using the Timer class in the flash.utils package. I'd create a Timer that fires once a minute, determines the clock time, and checks to see if there are any alarms to display. The Flash Player doesn't have multiple threads. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 12:46 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] scheduled functions Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark
RE: [flexcoders] scheduled functions
Having a single long Timer interval is worth trying, but I'm worried that Timer time might not match clock time over a long interval. That's why my recommendation was to make a Timer that fires every minute and checks the clock time. - Gordon From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Brian Holmes Sent: Monday, December 18, 2006 1:07 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] scheduled functions Start a Timer() when the application loads with it's delay property from the time the app starts till the time you wish to fire an event. For example the app starts at 8:00 am, and you want to show a pop up at 5pm to remind the user to go home, You just take the difference in time which is 9h and turn that into milliseconds and set your Timer.delay = the time difference. ( the delay is the time between firing events, so you could set it to every hour if you wanted to show a pop up every hour ) Then, register an event handler for Timer.timer or Timer.timerComplete events that accept a TimerEvent And there you go. When the Timer is complete it'll fire an event to your handler which then displays your popup. Look in the Timer, TimerEvent classes B.. -Original Message- From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of Mark McCray Sent: Monday, December 18, 2006 1:46 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] scheduled functions Hey there, Could anyone point me in the right direction with the following task: Is it possible to create events that happen at specific times while the app is running? Something like cron but for a client side flex app? Can make some function that runs in its own thread or runs in the background while that might be able to fire events based on system clock time? As an example, let's say that you are in a calendar app, and you want it to pop up an alarm at 4:15pm to alert you of a meeting? Can this be done without using a server side/FDS messaging push? Thanks, mark -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links *** The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed. If you have received this e-mail in error please notify the sender by return e-mail delete this e-mail and refrain from any disclosure or action based on the information. ***