views:

57

answers:

1

Hi, working on making a flash program that loads about 1000 jpegs and then plays them like a movie. Have all the buttons and stuff working but the time it takes for an image to load is so high that the movie can't be played at 30 fps. I've tried multiple ways of fixing this

  1. using 1 scrollpane and changing its source ever 30 ms. This one is the worst but simplest. Flickers cause strobing and it is unwatchable.

  2. used 2 scrollpanes that were duplicates of each other until I had to load. I would then make that one invisible, load it , then make it visible. Then load the background one. Works but same problem as the first at high speeds, just less severe.

  3. used 1 scrollpane per image . This works great, except that it fails miserably on any more than 100 of them due to the number of objects. DON'T TRY THIS FOR LARGE SETS OF IMAGES

Has anyone else experienced/solved/wants to help me solve this? None of my fixes have worked.

Currently using action script 3, but will change if its not possible in that.

Also, I want to be able to zoom in and then scroll around the window hence the scrollpanes, but if that's not possible its a sacrifice I'm willing to make

+2  A: 

2 is on the right track. Normally this is done using double buffering (#2), but it seems flash is too slow for that.

You might need to use triple buffering or quad buffering. You have n buffers in a cirular queue, you issue loads on all of them, then display at 30fps. When the i'th frame has been displayed, you add the i+n image to the queue, and issue a background load.

Byron Whitlock
So currently my frame interval is +1 which works great for the queue style. But what if I let the user select a +k action to jump ahead multiple frames or a -1 or -k to let them play in reverse? Would it be possible to implement this functionality with the multipane queue system?
msandbot
Sure, when the user wants to play in reverse, you iterate the queue backwards. You would need to invalidate all the other buffers in the queue, and replace with the reverse data. This would cause a slight delay as buffers are loading.Ditto for jumping ahead. Let them jump to the kth frame, put that in the 0 buffer, invalidate all other buffers, and continue to load the next frames.
Byron Whitlock