|
-
Senior Member
Problems processing & storing text. MX04
Hi,
Set out below is an amended version of a script that I have written that is part of a larger section of code.
What I would like it to do is take in a string of text from an array, add HTML tags to the words that require it & store the amended string back in the array.
I have tested out the section that creates the text with the HTML, the “findWord“ function, & that works fine on it's own with a single string of text, the problem & am having is with the processing & storage of multiple elements.
Any help, as always, much appreciated
code: my_txt.html = true;
hold_array = ["Frank goes to London to be in London", "Paul is a big noise up in the City of London", "John works hard on his computer in London"];
function findCard(theString_str, card_str) {
var textSplit_array = new Array();
var holdString_str = new String();
var colorCard_str = "<font face='andalus' size='14' color='#FF0000'>"+card_str+"</font>";
textSplit_array = theString_str.split(card_str);
for (a=0; a<=textSplit_array.length-1; a++) {
if (a<=textSplit_array.length-2) {
holdString_str += textSplit_array[a]+colorCard_str;
} else {
holdString_str += textSplit_array[a];
theString_str = holdString_str;
//my_txt.htmlText = theString_str;
}
}
}
for (a=0; a<=hold_array.length; a++) {
findCard(hold_array[a], "London");
}
my_txt.htmlText = hold_array[0];
Last edited by pup100; 04-08-2009 at 05:39 AM.
You will know everything when you know you never will.
-
did you try taking your clothes off and then compiling it? works wonders when i have a flash problem
-
Senior Member
Yeah done that & have got a banana sticking out of my backside you nuisance.
You will know everything when you know you never will.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|