Repeat an action every frame
Posted on 2006-11-14
I’m running Flash 8 and have a question about how to repeat an action on every frame.
I have a movie that has about 600 frames and I need an actionscript to run on every frame. Initially I thought I could just create a layer with a keyframe at the first frame and another at the last one. Then include an action in the initial keyframe and hope that the action is executed every frame…that didn’t work.
So now I’m in need of help.
To be more specific, I have a slider and need to record the value of the slider (user moves it throughout the movie to indicate enjoyment) every second (or every frame…either works). So the code should look something like this:
On enter frame -> get value from slider -> store value from slider in array -> increment counter -> goto next slide
I could put the equivalent of that in every single frame (keyframe each), but as you can imagine this is not a very elegant or practical solution.
Any help is appreciated.
Thanks in advance!