PDA

View Full Version : load external text files in sync with flv cuepoints


curiouscat
10-19-2005, 08:16 AM
been going bonkers over this for days, so would appreciate any input, please.

i've been able to puzzle out how to use an event listener with embedded cuepoints in an flv video (using a FLVPlayback component instance). but this is a very general understanding and i can't figure out how to do something specific that i need.

specifically, i need to load a series of external text files that will act as subtitles to the flv. The embedded cuepoints within the flv will act as the triggers that load the text files one after the other (e.g. subtitles01.txt to subtitles12.txt).

i have found zero documentation or references for the kind of functionality i need (specifically using FLVPlayback), so i could really really use suggestions from experienced flash users. thank you!

deadbeat
10-19-2005, 05:52 PM
As the text files will take time to load, if you want them in sync with the FLV, you will really need to load all the text files up front, and then just use the cue point listener to set the text fields based on the variables loaded from the text files...

K.

curiouscat
10-24-2005, 04:38 AM
hey deadbeat,

thank you for responding. sorry i've been away for work. i don't quite understand your suggestion but to make my problem clearer:

my project is currently in slide format because that used to be the easy way to synchronize content with video cuepoints. but maintenance becomes cumbersome when there are a lot of slides. i currently use the following AS in frame one of each slide timeline:


this.focusEnabled = false;
// Load text as variable and assign it to
// the dynamic text field
var subtitles_lv:LoadVars = new LoadVars();
subtitles_lv.onLoad = onText;
subtitles_lv.load("subs01.txt");
function onText(success:Boolean) {
if (success) {
slide01_txt.htmlText = subtitles_lv.subs;
} else {
slide01_txt.text = "unable to load text file.";
}
}


so right now, the subtitles change as each slide changes (i.e. has nothing to do with the video cuepoints). but this means i have to put this code plus a dynamic text area on each slide.

i've been trying to dispense with the slide format altogether and just load the subtitle text files as each embedded cuepoint fires. this way, i'll have only one text area, one scroll bar, etc. however, i have no idea how to use embedded navigation cuepoints to dynamically load external text files. moreover, each unique cuepoint must be able to load a specific text file to enable non-linear navigation (e.g. user clicking on chapter or section buttons).

hope this helps you give me pointers. thanks!