ActionScript flash control to 'play' visualisations
I'm new to Flash and ActionScript programming, so excuse me if I'm missing some basics here...
I'm building an application which will have a control to play, pause, step forward & step back through different versions of my visualisation - like the controls on your tape deck, but moving my visualisations through time, instead of that battered old Simon & Garfunkel recording.
I would have thought that my various animations would listen out for a particular event which fires on each 'beat' and tells it the time currently on the time line. My 'play' button then kicks off some code which causes one of these 'beat' events to be fired every second (or 5 seconds, depending on the speed selected). The 'step forward' button would cause a single event to be fired, and so on.
Assuming my design makes sense, I'm not clear how I would generate those events at regular intervals.
Alternatively, my desig开发者_JAVA技巧n might not make sense or be the most effective one for the job.
Very grateful for any input on this.
Thanks,
Martin.
There's also frames per second and events firing in each frame (look for onEnterFrame). Timer doesn't seem a bad choice. If there's lots of processing going on, frames/second can get delays. For instance, if you set it to 30 frames/second in your fla, then at certain points (when heavy processing is done) it can drop to less frames/second. If you are doing a very processor intense calculation, Flash can even stay for a couple of seconds in one frame. I guess the same goes for Timer which will probably use onEnterFrame in its implementation.
精彩评论