Ted Patrick > { Events & Community } > Adobe Systems


From the Vault - Interval Manager 1.012

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



Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flash