Is there a way to update the time-to-fire of a function set up with setTimeout() ? I know I can cancel and I suppose I could re-set them, but then I would have to keep track of all the timers in an array… It seems un-ideal.
Heres what I’m trying to do:
I have a fairly complex flash move with lots of pictures moving around and fading in and out, at very specific times. The timing is very picky. I accomplished it by using a ton of setTimeout() calls in actionscript to plan everything out in a linear fashion (I dont use the timeline). Heres example pseudocode:
t=0; t+= 1000; setTimeout(zoomIn, t); t+= 2000; setTimeout(PanLeft1, t); t+= 0000; setTimeout(PanLeft2, t); t+= 1500; setTimeout(Fade1, t); t+= 3000; setTimeout(zoomOut1, t); ...
Using this structure it was extremely easy to change the timing of any particular effect.
Heres the problem. Due to size constraints, we now have to load several of the images from a server on demand after the movie starts playing. IE, they cannot be embedded in the SWF. If an image isnt ready (downloaded) yet when it comes time do display it, I need to PAUSE everything where it is and wait for the image. How can I achieve this, given how Ive built it?
Using setTimeout(), I have everything planned out in advance. Is there any way to update the time that setTimeout fires? Maybe thats not even the best way to do it. Im open to ideas!