Subtitle xml flash video

right I have subtitles working,

but i want it so that if you scrub back through the video to any point, the correct subtitle appears.

I’m thinking something like…

 
for (i=0; i<subTitleArray.length; i++) {

    //
    if (subTitleArray* > ns.time && subTitleArray[i-1]< ns.time) {
     //
     say index i" number which I can then use to call the correct subtitle
    }
}

thanks