Event when the time changes?

I want to be able to perform a function at an exact time specified by the user. The time will always be an exact hour and minute, so I think that I just need to check once per minute. But, I want it to be just at the point where the minute changes. For example, if a user sets time for '04:30 ' I want the function to run when the clock on the PlayBook goes at 04:30 (preferably as close as possible). But if my timer runs a function listening every minute and it starts between the minutes for example "2:00:30" then he know what "02:01" until he has "2:01:30", exactly one minute after it starts.

I could run a function on each picture, but I didn't it would be the best way to do it.

EDIT: I guess the obvious solution for some could be just check once a second, but this really the most effective way?

Is there some sort of time, or in some other way event listener to do?

This is not tested, but it might do what you want:

import flash.events.TimerEvent;
import flash.utils.Timer;

...

var secondsTimer:Timer = new Timer(1000);   // 1000 milliseconds or a second delay
secondsTimer.addEventListener(TimerEvent.TIMER, onSecondsTimer);
secondsTimer.start();   // start timer

...

secondsTimer.stop();    // stop timer

private function onSecondsTimer(e:TimerEvent):void
{
    var currentTime:Date = new Date();  // get current date/time

    if(currentTime.getHours() == userSetHour && currentTime.getMinutes() == userSetMinute)
    {
        do something
    }

}

Tags: BlackBerry Developers

Similar Questions

  • Is there an event when the model color depth/pixel format is changed?

    Is there a way I can detect the change in depth of color in a composition?
    I know that I can react differently by calling PF_GetPixelFormat() on render for the format/bit depth of current, but I was wondering if there is a way to detect and react to the event when a user changes the number of colors in the publication manual?
    Basically, what I want to do is hide/change settings in the ECW according to the bit depth.

    Any help appreciated :-)

    You can use PF_UpdateParamUI during the call to render to force AE to refresh the user interface.

    You can also hide/show params at any time using AEGP_SetDynamicStreamFlag and AEGP_DynStreamFlag_HIDDEN.

  • Value change event, be it be programmed to trigger only when the USER changes the value?

    The structure I set up is the following, I have a control in which the user chooses a value when they choose this value, the value change event takes place setting in the device. Then I am bed in unit values and display them in this control via a property node.

    My problem is that whenever I read back a new value in the control, he takes this as a value change event and resets the value within the system, is it possible to make this event don't move when the user changes the value?

    Yes!

    My thoughts are that you use a Value property (signalling) node to display for the control. That will trigger another call to event.

    Use the NO signs of property value node or a local variable.

    Your postal code, if this isn't the case, then we can help you understand what is happening.

  • Having a problem in DateFormat when the time zone is changed...

    Hi, the following code converts a Date string to a Date which I am able to successfully... The problem I am facing is when I put the Moble zone as the format of Casablance (GMT) and my Format for a Date string is "2009-09-27 03:02:00:00 of" "" then I am to get the hour of the date as "kills Sep 27 03:02:00 GMT 2009", but when the time zone is changed to Canberra, Sydney (+ 10), the Date is "Mon Sep 28 19:37:13 Australia/Sydney 2009"... which is not the correct date in strgin Format ' "» nicely in this matter helps no matter what time zone after the conversion, I should get the date given to a string date... help kindly with respect to thei...

    public static Date getDateTmeFrmStrgFormat(String strDate)
         {
    
             Date date;
             String month,day,year,hour,min,sec;
                         month = strDate.substring(0,strDate.indexOf("/"));
                if(month.length() < 2) month = "0" + month;
    
                strDate = strDate.substring(strDate.indexOf("/") + 1);
    
                day = strDate.substring(0,strDate.indexOf("/"));
                if(day.length() < 2) day = "0" + day;
    
                strDate = strDate.substring(strDate.indexOf("/") + 1);
    
                year = strDate.substring(0,strDate.indexOf(" "));
    
                strDate = strDate.substring(strDate.indexOf(" ") + 1);
    
                hour = strDate.substring(0,strDate.indexOf(":"));
                if(hour.length() < 2) hour = "0" + hour;
    
                strDate = strDate.substring(strDate.indexOf(":") + 1);
    
                 min = strDate.substring(0,strDate.indexOf(":"));
                if(min.length() < 2) min = "0" + min;
    
                strDate = strDate.substring(strDate.indexOf(":") + 1);
    
                sec = strDate;
                if(sec.length() < 2) sec = "0" + sec;
    
                //sec = "00";
                date = new Date (HttpDateParser.parse(year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec));
                //date = new Date (HttpDateParser.parse(year + "-" + month + "-" + day + " " + hour + ":" + 00 + ":" + 00)); 
    
                return date;
            }
    

    Like this.  This code is NOT tested, it is presented only to explain the use of the calendar in this situation.

    public static Date getDateTmeFrmStrgFormat(String strDate)     {         String month,day,year,hour,min,sec;         month = strDate.substring(0,strDate.indexOf("/"));         strDate = strDate.substring(strDate.indexOf("/") + 1);         day = strDate.substring(0,strDate.indexOf("/"));         strDate = strDate.substring(strDate.indexOf("/") + 1);         year = strDate.substring(0,strDate.indexOf(" "));         strDate = strDate.substring(strDate.indexOf(" ") + 1);         hour = strDate.substring(0,strDate.indexOf(":"));         strDate = strDate.substring(strDate.indexOf(":") + 1);         min = strDate.substring(0,strDate.indexOf(":"));         strDate = strDate.substring(strDate.indexOf(":") + 1);         sec = strDate;         Calendar cl = Calendar.getInstance();         cl.set(Calendar.YEAR,|Integer.parseInt(year));         cl.set(Calendar.MONTH,|Integer.parseInt(month)-1);         cl.set(Calendar.DATE,|Integer.parseInt(day));         cl.set(Calendar.HOUR_OF_DAY,|Integer.parseInt(hour));         cl.set(Calendar.MINUTE,|Integer.parseInt(min));         cl.set(Calendar.SECOND,|Integer.parseInt(sec));         return cl.getTime();     }
    
  • How to register for an event when the device is connected to the PC in USB mode or sync

    I develop application on blackberry with phonegap.

    I want to hear event when the BlackBerry device is connected to the PC by USB MODE or sync.
    I saw mediagallery and applications Filemanager showing the dialogue that the application cannot be used when connected to the PC in USB mode.
    I want to display dialog similar to my request.
    Can anyone please help on how to do it.

    I saw blackberry webworks API

    public static Boolean blackberry.system.isMassStorageActive)

    who says if massstorage is active or not.

    But I can't keep on request this API every time. I'm looking for an API that gives me the reminder.

    Can you please help.

    On the side of Java, this can be done by implementing a FileSystemListener and the rootChanged method:

    public void rootChanged(final int state, String rootName) {
        if (rootName.equalsIgnoreCase("sdcard/")) {
            if (state == FileSystemListener.ROOT_ADDED) {
                /* SD Card is available. */
            } else if (state == FileSystemListener.ROOT_REMOVED) {
                /* SD Card is not available. */
            }
        }
    }
    

    I was not able to find a corresponding WebWorks API or API community well, so I think you need to create your own custom extension to implement this feature of the listener.
    https://developer.BlackBerry.com/HTML5/documentation/using_javascript_extensions_1866976_11.html

  • Event when the application closes

    Hi *.

    is there an event when the PlayBook application is about to close? I would like to save at this time where the configuration etc.

    Not that I know of.  It will be an event at the level of the AIR that is triggered when this problem occurs, and I do not think that such an event is currently on the Tablet OS.

  • Performance graphics problem because the time change?

    Hello

    It seems that there is a problem with the graphic display of Performance on my system (vsphere 4.1 esx 4.0 servers) from 31. October 2010. I suspect it has something to do with the time change that occurred last Sunday night in my area of time (time Switzerland).

    (1) in time real Perfomance data are displayed on the VM and ESX Server objects.

    (2) any other array performance (daily, weekly, annually) fails to display

    If 3) use graph custom, I can go back until 1 November (until today), but not yet back. This is why I think it has to do with the time change of last Sunday.

    When I look at stats.log, there are error messages as in the txt File attached.

    Any ideas? It is not tragic if the old performance data are lost... were put in place with a new DB in September... but I would like to see in the future the performance stats...

    Here a KB for this issue: http://kb.vmware.com/kb/1030305

    To work around the problem of time atothr, you can try to use "Advanced" on the performance tab reports.

  • How to list the when a Table is created, and when the last change?

    Is there a way to know when a TABLE was created originally, and when the last change (=. for example, the last INSERTION of a line or UPDATE a line)?

    Peter

    Hello!

    select created,last_ddl_time from dba_objects where object_type = 'TABLE' and object_name = 'table_name'
    

    created ways to create object (table)
    last_ddl_time means when the structure of tables was the last modified time

    But there no opinion with dml last on the table. You must provide this with a few columns on table (Last_dml_time) that should be filled with
    Some database triggers

    Or if you have enabled AUDITING, then last time dml is registered also in audit trail

    T

  • The mouse freezes when the cursor changes icon

    Hello. The problem is that when the cursor changes its icon for example when taking screenshot with cmd + shift + 4 it freezes until I'll click. Basically, it moves only when selected. It is annoying when I'm working in C4D where when you draw cursor change and makes it almost impossible but it's not in Photoshop.  Someone has experienced something like this? Or maybe some ideas what the problem is?

    I want to mention that this happens only on one of the two user accounts on the computer

  • Satellite A500-13F - strange noise when the context changes

    I hear "zzzzzzzzz" when the substantive change and when I go to open the page to another;

    I tried to change the realtek audio driver, but it does not work and when I played, it be very strong and get high...

    Please help me!

    Hello

    Whence the noise?
    It comes from speakers or HARD drive maybe?

    > I hear "zzzzzzzzz" when the substantive change and when I go to open the page to another;
    Have you noticed that noise only with internet explore?
    It is not using batteries or adapter only?

    Please check this and please provide more information and details.

  • Intercept touch green application event when the device is locked

    Hi, I'm new to blackberry. What I want is I want to take a key event (green or red button) when the device is locked and do specific tasks in my application that runs in the background if this button is pressed. Is this possible? How can I do?

    Just to be 100% accurate, it is possible for a keyListener (look to the top of the class) to pick up some events even when running in the background.  It can be different events when the device is locked.  Indeed, the events may be different depending on whether the "locked" screen is currently displayed or not. And the entire lot is dependent on operating system level, in other words, the same device running two different levels of OS will possess differently in terms of what keys can detect a listener in the background.

    So if you have a BONE and a specific device, so it might be something you can do, especially if it is an older operating system.  However if you try to create something that works generically, then know that I've tried and failed!.

  • Is there a fix for when the reader changes all my program icons?

    Is there a fix for when the reader changes all my program icons?

    See http://helpx.adobe.com/acrobat/kb/application-file-icons-change-acrobat.html

  • once disconnected when I try to log on to my computer using a temporary profile, this has started to happen since the time change, can someone help me

    The night of time change my backup computer shutdown and using a temporary profile once I disconnected. I can still see my pic and music Exchange reacently file but I want to turn my computer off when you are not using it and record what I saved on the computer the last time.

    Hello

    I suggest you to follow the steps in this link and check if it helps:

    http://support.Microsoft.com/kb/947242/en-us

    It will be useful.

  • Is there an event when the mobile connections are changed

    Hi, expert,

    I'm looking for an auditor check the following:

    1. when the phone is connected to a mobile network not connected

    2. when the phone is connected to another mobile network (another carrier or wifi) from current network

    3. the current mobile network connection is dropped.

    I found of initailly than ConnectionAttemptLIstener (http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/io/transport/ConnectionAttempt...). I thought I could use it to change mobile network connection. It turns out that I just couldn't. He listens to the event on ConnectionFactory which really is a connection on the connected mobile network.

    Did some research and I could not find any related information.

    So is it possible for me to achieve what I said at the outset?

    You can use a combination of CoverageStatusListener and RadioStatusListener to have access to these events.

    CoverageStatusListener will let you know what type of network access you have access from your coverage (by cell phone connectivity, etc.) WLAN network and which network transports are available).

    RadioStatusListener will let you know when the changes on the cellular network occur as signal changes, changes the base station etc.

    RadioInfo class can also be used to receive information on the current mobile network too.

    Kind regards

  • CS6 AIR flash device emulator throws off events when the sensors are changing

    I'm developing an application in Flash CS6 targeting AIR 21.0.0.176 for Android.  I've implemented the NativeApplication.nativeApplication Event.ACTIVATE Event.DEACTIVATE listeners.  These work as expected when the Android device is running standalone or if I am debugging via the interface to CS6 USB. However if I have a deployment on the simulator of premises, whenever I use the Simulator interface to generate a change in the accelerometer or location, the application then receives a DEACTIVATE event.

    It's difficult troubleshooting because on my manager to DEACTIVATE event by stop all the interactive features in the application.

    Any ideas please?

    I guess only the two ways to work with the configuration of the listener. It is not a bug, however, the window of the Simulator is a different application, when you select you have disabled your app, it did the right thing. But in this case, you don't want him to do the right thing, then use the work around.

Maybe you are looking for

  • Dynadock U with USB powered external DVD drive

    Toshiba dynadock U PA3575A-1PRPIomega superslim DVD 31785700 dvdrw8x-uASUS U36J laptop Windows 7 64 bitlatest updates for Windows and installed Dynadock Hi, this external DVD drive has 2 USB connectors (data and power) and no power supply.The dynadoc

  • OfficeJet Pro 8600 Plus: now really can not print from Officejet Pro 8600 Plus

    It is my second attempt to get help.  First aid made it worse.  I had been unable to print from my printer wireless to my MacBook Pro, iPad, or iPhone.  After 20 hours I managed to do print from a cable (it sees my network but none of my devices can

  • Why it's start to appear when I get new updates. ?

    I click on the button set to day and when I restart message is beginning to apear:"There is an IP address conflict with another system on the network"Help, please! What should do?

  • user profile service sign on refused

    When I try to sign on everything I get now, it is a message OF THE PROFILE SERVICE service USER has NOT THE CONNECTION, user profile could not be loaded, I updated windows Visa yesterday with the automatic update, I have three accounts on computor an

  • My office was strewn with icons...

    My office was littered with icons. I did what I know now to be a jerk decision - I moved to Word, Excel and Outlook to the trash. I never emptied, but on recovering and trying to open these programs I get: this action is only valid for products that