A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Problems processing & storing text. MX04

  1. #1
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575

    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.

  2. #2
    Junior Member
    Join Date
    Apr 2009
    Posts
    12
    did you try taking your clothes off and then compiling it? works wonders when i have a flash problem

  3. #3
    Senior Member pup100's Avatar
    Join Date
    Oct 2004
    Location
    Close
    Posts
    575
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center