Stuff I am building:


Ted Patrick - Events & Community @ Adobe Systems


Note: This is the personal blog of Ted Patrick. The opinions and statements voiced here are my own.



From the Vault - Interval Manager 1.012

DIGG IT!     0 Comments Published Friday, February 13, 2004 at 9:42 AM .

I wrote this along time ago March'03 to manage Intervals within PowerSDK:FLOW. A recent thread on Flashcoders "setInterval id: possible...", prompted me to set this one free. It makes managing intervals easy and more flexible at the same time.

Interval Manager provides the following:

1. Structured way to add and remove Intervals from the player
2. Allows managed intervals to support many functions
3. Allows interval and interval functions to support custom arguments and custom scope.

Interval Manager

#include "Interval.as"

// Add a new interval to the player
// interval time = 100
// default arguments for Interval = [0,1,2,3,4,5]

myInterval = Interval.addInterval('ted',100,[0,1,2,3,4,5])

// Add a function to the interval you just created
// name the function = ted
// function = trace
// arguments = ['HelloWorld']

myInterval.addItem('ted',trace,['HelloWorld'])

output:
'HelloWorld'
'HelloWorld'
'HelloWorld'
'HelloWorld'
'HelloWorld'
...

// destroy all intervals and interval functions!
Interval.removeAll()

There are lots of other uses and it makes Intervals easier to manager within the player.

cheers,

ted ;)

0 Responses to “From the Vault - Interval Manager 1.012”

Post a Comment

Where to find me:

Ted on Twitter - @AdobeTed
Ted on Adobe Groups
Ted on LinkedIn
Ted on Facebook
Ted at Adobe


Latest

Lists

Links

Jobs

Flex Jobs
city, state, zip

Archives