PDA

View Full Version : Animation based on milliseconds


dubbeat
04-04-2008, 09:17 AM
HI,

I'm having trouble solving an animation problem.

I've got a movie clip of a speaker that is 10 frames long. (An arbitrary value I pulled from nowhere). The animation of the speaker simply goes from small to large to simulate it pulsing or pounding.

I'm trying to find a way to get the speaker to animate every 431 milliseconds for a duration or 431 milliseconds or less. The value of 431 can change and be a value of X.

So in reality I need to get the speaker to animate every X milliseconds for a duration of X milliseconds or less

Any insight on how to approach this problem?

Thanks,
dub

Hambo
04-04-2008, 11:42 AM
Take a look at the timer class.

setTimeout () function
Runs a specified function after a specified delay (in milliseconds).

setInterval () function
Runs a function at a specified interval (in milliseconds).

dimpiax
04-04-2008, 11:45 AM
Read about class Timer. =)