Timer that "fires" multiple functions

Hi all
I really need a Timer that shoots multiple functions. The
Timer Class just handles one function and therefore is not good
enough for my project. The Timer should work something like this:
After 1 seconds fire functionOne
After 4 seconds fire functionTwo
...and so on...
Time is really crucial in my project (down to milliseconds)
so I really can´t use the Timer Class and fire "new" Timers
all the time because Flash needs some milliseconds to process all
the code and in the end it sums up to kind of a lot of time.
I hope I have been clear enough.
Any advices on how to do this?
Regards
//Leine

Leine,
> I really need a Timer that shoots multiple functions.
The Timer
> Class just handles one function and therefore is not
good enough
> for my project.
The first thing that comes to mind is, use numerous
instances of Timer.
> Time is really crucial in my project (down to
milliseconds) so I
> really can?t use the Timer Class and fire "new" Timers
all the
> time because Flash needs some milliseconds to process
all the code
Aha. Then how about a single "master timer" that keeps track
of a
cumulative delay, using modulo to trigger separate functions?
var cumulativeDelay:int = 0;
var timer:Timer = new Timer(500, 0);
timer.addEventListener(TimerEvent.TIMER, masterTimer);
timer.start();
function masterTimer(evt:TimerEvent):void {
cumulativeDelay += 500;
if (cumulativeDelay % 1000 == 0) trace("every second");
if (cumulativeDelay % 2500 == 0) trace("every two and a half
seconds");
if (cumulativeDelay % 4000 == 0) trace("every four
seconds");
Not sure if that would be any more efficient than numerous
instnaces,
but worth a shot.
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design."

Similar Messages

  • How to create a function that returns multiple rows in table

    Dear all,
    I want to create a funtion that returns multiple rows from the table (ex: gl_balances). I done following:
    -- Create type (successfull)
    Create or replace type tp_gl_balance as Object
    PERIOD_NAME VARCHAR2(15),
    CURRENCY_CODE VARCHAR2(15),
    PERIOD_TYPE VARCHAR2(15),
    PERIOD_YEAR NUMBER(15),
    BEGIN_BALANCE_DR NUMBER,
    BEGIN_BALANCE_CR NUMBER
    -- successfull
    create type tp_tbl_gl_balance as table of tp_gl_balance;
    but i create a function for return some rows from gl_balances, i can't compile it
    create or replace function f_gl_balance(p_period varchar2) return tp_tbl_gl_balance pipelined
    as
    begin
    return
    (select gb.period_name, gb.currency_code, gb.period_type, gb.period_year, gb.begin_balance_dr, gb.begin_balance_cr
    from gl_balances gb
    where gb.period_name = p_period);
    end;
    I also try
    create or replace function f_gl_balance(p_period varchar2) return tp_tbl_gl_balance pipelined
    as
    begin
    select gb.period_name, gb.currency_code, gb.period_type, gb.period_year, gb.begin_balance_dr, gb.begin_balance_cr
    from gl_balances gb
    where gb.period_name = p_period;
    return;
    end;
    Please help me solve this function.
    thanks and best reguard

    hi,
    Use TABLE FUNCTIONS,
    [http://www.oracle-base.com/articles/9i/PipelinedTableFunctions9i.php]
    Regards,
    Danish

  • When I open fire fox and open uther lings I'm geting masage that fire fox is not resonding and some time loads after a while and some time not.

    When I open fire fox and start opening tabs it tell me that fire fox is not responding and after a while some time will open and some time not. What can I do to correct this. If I need to reload the fire fox let me know how I don't wont to loose all my book marks. Thank you for your help.

    Try to update to Firefox 24 (just been released).
    It is possible that your security software (firewall, anti-virus) blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    *https://support.mozilla.org/kb/Server+not+found
    *https://support.mozilla.org/kb/Firewalls
    *https://support.mozilla.org/kb/fix-problems-connecting-websites-after-updating
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Hello, I just got an iPhone 4S and it seems that the bluetooth function in it doesn't work. I tried few times to pair it to other non Apple phones and it never worked. Does anyone has an idea how to solve the problem? Tks.

    Hello, I just got an iPhone 4S and it seems that the bluetooth function in it doesn't work. I tried few times to pair it to other non Apple phones but it never worked. Does anyone has an idea how to solve the problem? Tks.

    This is not a feature of iPhone, iPad or iOS.
    Bluetooth is supported for stereo headsets/speakers, handsfree telephone
    devices/headsets, some keyboards, some peer-to-peer apps from the
    app store and internet tethering where provided by the carrier.
    Other than this it will not connect to a phone/computer/device.  (thanks to ckuan for the wording)

  • After installing IOS6: after erasing the history of Safari, the next time I fire up Safari, I see a split-second of the last displayed screen of Safari. Not a big issue but it should not be that way.

    After installing IOS6:
    After erasing the history of Safari, the next time I fire up Safari, I see a split-second of the last displayed screen of Safari.
    Not a big issue but it should not be that way.

    Download a new copy of the Firefox program: http://www.mozilla.com/firefox/all.html
    Trash the current Firefox application to do a clean reinstall.
    Install the new version that you have downloaded.
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • HT2090 hello, my eyesight issue happens occasionally, from time to time i run multiple apps that use the isight camera. when i close each app the isight camera's green light is still active. When that happens the only way to stop the isight camera is to r

    hello, my eyesight issue happens occasionally, from time to time i run multiple apps that use the isight camera. when i close each app the isight camera's green light is still active. When that happens the only way to stop the isight camera is to reboot.
    Is there a way to use activity monitor to identify and kill the process controlling the isight? My apologies in advance if this sounds windows (task manager) like.
    Thanks

    tqtclipper wrote:
    hello, my eyesight issue happens occasionally, from time to time i run multiple apps that use the isight camera...
    http://support.apple.
    com/kb/HT2411: Your camera can be used by only one application at a time.
    (Over time, Apple has changed the built-in camera's name on newer Macs from "iSight" to "FaceTime" and then to "FaceTime HD."  Regardless of the name of your Mac's built-in camera, the same info and troubleshooting applies.)
    tqtclipper wrote:
    ... Is there a way to use activity monitor to identify and kill the process controlling the isight? ...
    http://support.apple.
    com/kb/PH5147:  You can quit any process you can see in those listed in the window that opens when you use Activity Mornitor's 
         Window >
    Activity Monitor
    menu command.
    Message was edited by: EZ Jim
    Mac OSX 10.8.3

  • There are times when I try to start firefox 3.6 that it does not come up,but when I click it again, I get fire fox is running but not responing, close fire fox, or shut down computer. There are other times that it starts up normaly wit no probs

    # Question
    there are times when I try to start firefox 3.6 that it does not come up,but when I click it again, I get fire fox is running but not responding, close fire fox, or shut down computer. There are other times that it starts up normally wit no probs
    ..

    Not using any mouse pad, I have a very smooth desktop. But I just tried to use a sheet of A4 printing paper, but no result, the problem persisted.
    Someone on this forum suggested, that USB3 may interfere with the magic mouse.
    I have 2 LaCie HDD's about 70 cm away from the mouse, I use them on Thunderbolt. But in operation or not - the result is the same, the mouse plays up! Just now I was clicking the desktop and the mouse created a new folder!!
    Thanks for the advice, Bee
    Cheers, Gerd

  • I want to save with alt s in the program Exact Online. This function is not working. this is the first time that i use this program with firefox.

    Question
    I want to save with <nowiki><alt><s></nowiki> in the program Exact Online. This function is not working. this is the first time that i use this program with firefox.
    '''edit''', mod escaped the '''<nowiki><s></nowiki>''' to prevent line through question

    Submitted too soon... To change your accelerator key for accesskeys to Alt alone (or a different combination), you can change a setting using Firefox's about:config preferences page.
    (1) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''ui.k''' and pause while the list is filtered
    (3) Make sure '''ui.key.generalAccessKey''' is set to its default value of -1 (or right-click and choose Reset if it is not).
    (4) Double-click '''ui.key.contentAccess''' to open a dialog box to change the value from its current default (on Windows, 5) to your choice of the following:
    * 2 = '''Ctrl''' (Fx default on Mac thru Fx13)
    * 3 = Ctrl + Shift
    * 4 = '''Alt''' (IE/Chrome/Safari default on Win/Linux)
    * 5 = '''Alt + Shift''' (Fx default on Windows & Linux)
    * 6 = '''Ctrl + Alt''' (Fx default on Mac from Fx14) (Chrome/Safari default on Mac)
    * 7 = Ctrl + Alt + Shift
    This should take effect as soon as you OK the dialog, so you can experiment in a separate tab. Other combinations are available if you want to try them. See http://kb.mozillazine.org/Ui.key.contentAccess (inaccessible at the moment?)

  • I keep getting a restore to previous session box every time that I log on to Fire fox--Why

    I am getting the "restore to previous session" box every time that I now start my Firefox browser get onto the internet. This is on my laptop. Why do I get this box on my start page. Is there a special method of signing off with the browser? This has been happening for several weeks.

    That is a new feature that started with Firefox 4.0, with the '''about:home''' homepage which was also new in Firefox 4.0. The previous session is saved automatically, unlike earlier versions.
    If you don't like seeing Restore Previous Session, change your homepage to a different web page. <br />
    http://support.mozilla.com/en-US/kb/How+to+set+the+home+page

  • Alert is not working for mutiple times for list "select" function in sapui5 XML view

    Hello All,
    I am trying to open an alert for multiple times for list "select" function. But it's opening for only one time .
    Please find code below.
    View Part
    <List id="contactedit" select="somefunction">
        <CustomListItem id="custom1" type="Inactive" >
    <content>
    <Label text="this is label" />
    </content>
    </CustomListItem>
    </List>
    Controller Part
    somefunction: function(oEvent){
    alert("this is an alert");
    Thanks in Advance
    D.Mohanbabu

    I think I saw this question in stack overflow. And I answered it :-)
    I believe that it is because you can only one item in the list and once the item is selected, re-selecting it will not fire the event.
    Try adding more items to the list and select different items.
    Thanks
    -D

  • Do you have a transaction scope that spans multiple requests.

    We have and application that includes multiple tabs, which are really iframe instances. We need to maintain state for the entire time the tab is open, which may be across multiple requests.
    I am not comfortable making all our backing beans "session" scope, and making them "request" forces us to do lots of work (DB access etc...) on every post-back to re-initialize the backing bean.
    I have been looking at both Shale and JBoss SEAM to give me this "conversational" scope. I have looked at "process" scope, however we may have the same backing bean in use for multiple tabs, therefore would need it linked to something like the viewId.
    Does ADF plan on enhancing the "process" scope functionality or is it OK to add SEAM or shale at the front-end of the ADF processing lifecycle?
    Your guidance would be appreciated.

    The processScope functionality seems pretty crude.
    I was looking to define which data elements of the backing bean need to be stored (maybe using annotations) and have them restored automatically before the APPLY_REQUEST lifecycle gets initiated. I can write this functionality, however I was looking for a more robust solution.

  • Is there a way to apply Time Remapping to multiple clips simultaneously?

    Is there a way to apply Time Remapping to multiple clips simultaneously? I'd like to uniformly speed up and slow down two different clips that are playing in a picture-in-picture setup. I’m hoping there’s a more elegant way to sync them up than just editing their Time Remapping functions individually (I already tried using an Adjustment Layer. It didn’t work).

    you can try nesting the two clips together, then control the time remapping of the nest.

  • One button, multiple functions

    Hello.
    I have used the loader script to load an external swf into current project. I have added a button to unload the external file when wanted, and was wondering if you could have multiple functions for that button, so that when you click it to unload it works as a 'home' button as well, and takes the user back to the mainpage again?
    AS3 btw.
    Might be wise to mention that im kinda new to adobe flash and as3, and not sure if the way i have used to load the external swf was the easiest. Seems like a few have had some issues with this subject before me as well.
    All pointers in the right direction is appreciated. Cheers.

    Thanks alot for answer Ned Murphy.
    As I've might failed to mention, is that the button is intended to do two things, unload and return to main page, at the same time. So basically a one click operation.
    To update the situation, I've tried this as a code;
    btnHeim.addEventListener(MouseEvent.CLICK,unloadSwf);
    function unloadSwf(e:MouseEvent):void {
        loader.unload();
    btnHeim.addEventListener(MouseEvent.CLICK,tilbaks);
    function tilbaks(event:MouseEvent):void{
        gotoAndStop(1,"Mainpage");
    It kind of work, as it unloads and takes you back to the main page. Only thing then is that the buttons on mainpage doesnt work any longer, and one of them disappear?
    I've never been this deep into AC3 i think, so not sure what the problem is, except for the fact that there is some issues going on.
    This is the error that shows up on 'output' after btnHeim is clicked.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at Mappevurdering_web_fla::MainTimeline/frame2()
        at flash.display::MovieClip/gotoAndStop()
        at Mappevurdering_web_fla::MainTimeline/tilbaks()
    Thanks again

  • Cartesian time data across multiple hourly rows

    Looking for a solution for exploding time rows into multiple rows by hour. For example, take a row like this:
    EventTime         EventLengthSeconds
    2014-04-25 13:31:16.857 6657
    What I need is multiple rows to allocate the time by hour like this:
    EventTime         EventLengthSeconds
    2014-04-25 13:31:16 1724
    2014-04-25 14:00:00 3600
    2014-04-25 15:00:00 1333
    I've crafted a solution using a derived table that I cross join to then use case statements, etc. but it's super ugly and I'm embarrassed to post it. 
    I'm thinking in SQL 2012 there must be a elegant and efficient way to do this with the new windowing functions that are available. 
    Thanks for any insights and suggestions.

    You need a table of hours for this problem. The more general concept is a table of numbers. That is, a table that spans the dimension you are working and provides a row for each discrete value.
    Below is an example how you can fill the table and then a query which uses this table:
    CREATE TABLE Hours (Hour smalldatetime NOT NULL PRIMARY KEY);
    WITH digits (d) AS (
       SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION
       SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION
       SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION
       SELECT 0)
    INSERT Hours (Hour)
       SELECT dateadd(Hour, Number, '20000101')
       FROM   (SELECT i.d + ii.d * 10 + iii.d * 100 + iv.d * 1000 +
                      v.d * 10000 + vi.d * 100000 AS Number
               FROM   digits i
               CROSS  JOIN digits ii
               CROSS  JOIN digits iii
               CROSS  JOIN digits iv
               CROSS  JOIN digits v
               CROSS  JOIN digits vi) AS Numbers
       WHERE  Number > 0
         AND  dateadd(Hour, Number, '20000101') < '20500101'
    DECLARE @eventtime datetime2(3) = '2014-04-25 13:31:16.857',
            @eventspan int          = 6657
    SELECT @eventtime AS EventTime,
           3600 - (60*datepart(minute, @eventtime) +
                      datepart(second, @eventtime)) AS EventSeconds
    UNION ALL
    SELECT Hour,
           CASE WHEN dateadd(second, @eventspan, @eventtime) >
                     dateadd(HOUR, 1, Hour)
                THEN 3600
                ELSE datediff(SECOND, Hour, dateadd(second, @eventspan, @eventtime))
          END
    FROM   Hours
    WHERE  Hour > @eventtime
      AND  Hour < dateadd(SECOND, @eventspan, @eventtime)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Slow Execution Time of Exponentia​l Function

    Hi,
    I am developing a program with large dataset (arrays size of around 1000*1000 elements).
    I realised that my program ran quite slow when calculating exponential for each array elements.
    So, I built a simple porgram to test the execution time for exponential vs multiplication on 1000*1000 array elements and found
    out that the period is ~25 times longer. Attached is the program (Labview 2011).
    The specs of my system are:
    1) Windows 7
    2) Intel i5 3Ghz with 4gb ram
    3) Labview 2011
    The actual program I built has a version in Matlab and uses exponential function as well. However, the execution time in Labview is around 10 times longer than the Matlab. I believe that the exponential function is the cause of this after making some analysis using built-in "Performance and Memory" tool and modification to the program.
    Is there any way I could make the exponential function runs faster? Or any better way to handle large array operation? (I have tested array operations with nested FOR loops and paralel execution but the results is not that great.
    Hope anyone can help. Thanks for any input.
    Attachments:
    Execution Time-Exponential Function.vi ‏11 KB

    Thank you for your answer. 
    I am sorry, I could not upload the real code since it is large and has lots of dependency. But, I wrote simple program both in Labview and Matlab as attached.
    I tried to make both program doing the same thing and put each element as random number between 0-1 to avoid any folding/optimization process.
    The Labview took around 974ms to complete the task while the matlab 177ms. If the the way I implemented them are correct, the Matlab is around 5 to 6 times faster than Labview to execute Exponential function.
    Attachments:
    Matlab Exponential Test.PNG ‏19 KB
    Labview Exponential Test.PNG ‏24 KB
    Exponential Test.vi ‏10 KB

Maybe you are looking for

  • X-Fi Loses Settings-- doesn't remember th

    I have a brand new Dell with an X-Fi, and it refuses to remember the settings after each reboot. It always goes back to "entertainment mode" and 4., when I want it to stay in "game mode" and 5.-- it also wipes out my THX settings, etc. Any help would

  • D-Link DIR-615 and iChat problem

    I had a netgear previously, but it broke after a year so I bought this D-Link. I never had any problems with iChat, but now I get disconnected from iChat every few minutes. Any thoughts?

  • How to find out  to find by which procedure a table column was updated

    Hi All, We have an attribute10 column of a table used in a DFF. This attribute is being updated for a specific reason in a code, but some other procedure is also updating the same column which is causing issue with the functionality. The update might

  • /dev/dvd missing?

    Hi all, I am  not shure if this is a right place for a post so be free to move it. This morning I wanted to rip one dvd. I use acidrip for that. I had put dvd in reader, fired up acidrip and when I pressed "Load dvd" as I usually do I got error messa

  • Can't start Weblogic -- null pointer exception

    Having a problem launching Weblogic 11gR1 from within Eclipse Galileo. It had launched fine the previous day, but now when I try to launch I get eclipse.buildId=I20090611-1540 java.version=1.6.0_16 java.vendor=Sun Microsystems Inc. BootLoader constan