flash actionscript:
summary:
* Using Flash MX 2004 Pro
* flv playback using media display component
* subtitle display, subtitles loaded using 'loadvars' from external textfile
* cuepoints created on load of the text file to display proper subtitle at the
appropriate time
* playback choppy, sluggish, and even crashes; performance is terrible
details:
I have created a projector that loads and displays an .flv (using 2004 MX PRO
media display component). While the video plays, subtitles are to be shown. I
have chosen to have the end-user be able to turn on or off the
subtitle display by pressing a button. This is accomplished by creating an mc
that reads in a text file that defines the times the subtitles are to be
displayed, along with the subtitle text. This text file is read in before the
video playback, an array of all the subtitle text is created and filled, and
cuepoints are created to sync the display of the subtitle text with the
flv playback.
The problem, is that now that all the code works and does what I want,
(subtitles can be hidden on the press of a button, the text is all synched,
etc) the performance is TERRIBLE! the playback struggles, hiccups, and
sometimes I get the dreaded "the script in this movie is causing Macromedia
flash player 7 to run slowly, if it continues to run, your computer may become
unresponsive. Do you want to abort this script?" error. NOT acceptable for
CDROM distribution.
The text files themselves are not that large (the largest is 35k). The number
of cuepoints aren't that many (the most cuepoints for one flv is 430, is that
'too many'?). The longest video is about 5 minutes long, at 12 fps (and yes,
they've all been squeezed).
The videos without any of the cuepoints defined play beautifully, but with all
these 'synch' points loaded and the subtitles being displayed, they're
unwatchable.
what can I do? I've been careful to unload all the previous video before
loading a new one. Are there some performance tricks I should be aware of that
I'm not using? I can't think of a better way to have subtitles being displayed
without embedding them in the video (which I DO NOT want to do, it's tedious
and slow, and prone to error). The whole reason I switched to MX Pro was this
cuepoint method, which isn't really working out for me.
Any performance tricks you can pass along will be greatly appreciated.