Saturday, May 20, 2006

Custom Intervals -- Pause, Extend, Change

SWF Example:





Class Files:
Interval.as

Source FLA:
IntervalExample.zip

On IRC tonight someone asked if it was possible to pause, or even extend an interval for a certian ammount of time. I wrote this class to allow you to do just that with an interval created via it. You can pause, unpause, change the interval (in real time with compensation), and extend the time of the current iteration of the interval. A basic method rundown.



  • Constructor

    • $f : The function you wish to have the interval call.

    • $s : The scope that the function resides in.

    • $d : The interval time (in milliseconds).




  • add
    --Creates the interval.


  • remove
    --Removes the interval.


  • pause
    --Pauses the interval (see Note 1).


  • unpause
    --Unpauses the interval (see Note 1).


  • extend
    --Extends the current iteration of the interval by $time.

    • $time: The time (in milliseconds) to extend the current iteration of the interval by (see Note 1).




  • changeInterval
    --Changes the interval time permanently.

    • $time: The time (in milliseconds) to set the current and all further iterations to (See Note 1).





If you peep the example file it should be comprehensive enough to give you a good idea of how to use the class. Please comment with any suggestions or complaints.



Note 1: These methods don't reset the interval. It will continue the interval from the point of pausing, extending, or changing.

3 Comments:

Anonymous Anonymous said...

Thanks very interesting blog!
My web site : cash advance payday loan

Wednesday, February 13, 2013 12:22:00 AM  
Anonymous Anonymous said...

Thanks very interesting blog!
Also see my web page :: cash advance payday loan

Wednesday, February 13, 2013 12:22:00 AM  
Anonymous Anonymous said...

Wow! This blog looks just like my old one! It's on a entirely different topic but it has pretty much the same layout and design. Great choice of colors!

Here is my weblog ... natural breast enhancement cream

Thursday, February 21, 2013 8:12:00 PM  

Post a Comment

<< Home