In Flash, I’v created a text/pictures/interactive document which is about 500 pages. All of the text is static text. I decided today it would be good to let the user search through it. My first thought was to copy all the text on each page and store each page’s text as a string, then take all the strings and store them as an array. And then I would use the code below to search through the array to find the word:
on(press) {
searchResult = "Result:
";
for(i = 0; i < 3; i++) {
searchReturn = pageList*.indexOf(search);
if (searchReturn != -1) {
searchResult = "Page " + (i + 1) + "
"
}
}
}
Yeah, so it returns the page that it’s on. Then I’ll have a second navigation component that lets the user type in a page number and have the playhead navigate there. However, having 500-600 pages, this code might be inefficient, and I would hate to type all the text manually into strings.
Is there any way I can capture all the static text that is published and store it as a variable or series thereof? (If I can only make one string, that works because I can use the split() function).
Also, I don’t know if my Flash will rollover and die when faced with iterating through a 500 string array.
Can any experienced AS people help me?