Hey Jayson, It sounds like the only problem with your algorithm is the periodical errors it runs into, where it breaks the html. If you put some elbow grease into it you could write a serious algorithm that analyzed the tag that was being evaluated for the cutoff point, and, if it were within a tag that would break if it was truncated at that point, then, you could truncate at the highest level tag, or, substring the point of entry of the parent tag and cut to the point of truncation (I have no idea if such a word exists.).
Here is an example of what I'm describing: '<font face="Verdana" size="9" color="#222222"><b>hello</b><br> a little text here, a little text there <b> die <br> <i> and have a nice day </i></b></font><br>' Lets say we evaluate this string to split in half, a reduction of 50 percent, but doing this would clearly break the html, correct? So, in the algorithm, there is an array variable that stores the opening tags of all the tags it's within. You can then cut the string at the cut off point, take the array of opening tags and prepend them to the string so that the html stays intact. So, cutting the string in half looks like this: 're, a little text there <b> die <br> <i> and have a nice day </i></b></font><br>' the html would break. In the example, the array would look like this: ['<font face="Verdana" size="9" color="#222222">'] it's the only tag the index is within, so you would take the array, join it using '' and prepend it to the beginning of the string: '<font face="Verdana" size="9" color="#222222">re, a little text there <b> die <br> <i> and have a nice day </i></b></font><br>' you can even add a little '...' string for the sake of legibility: '...<font face="Verdana" size="9" color="#222222">re, a little text there <b> die <br> <i> and have a nice day </i></b></font><br>' I hope I'm making sense, nonetheless, good luck. H _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders