Hi all i have a problem that i have no idea how to solve. I’ll start with what i’d like to be able to do.
i have a dynamic text feild which is being populater with text.
disText.text = “I may start “utopian island” soon. Then we can recline while the robots and the
animals do our bidding. Within reason. No monkeys in bras. &&about 1 hour ago from web”;
i can format this text like so:
myformat = new TextFormat();
myformat.color = 0x004487;
myformat.size = 16;
myformat.align = “center”;
myformat.font = “Arial”;
_root.disText.setTextFormat(myformat);
okay so that is all good.
Now i need to search the string and find the &&, any text after this point will need to be formatted in a different way.
i have done a search and replace
function searchReplace(block:String, find:String, replace:String):String {
return block.split(find).join(replace);
}
disText.text = searchReplace(_root.disText.text, “&”, “”)
so that the special characters are replaced with nothing but i cant find a way of findig out where in the string the special characters were and how to modify the text that is after the special characters i.e the about 1 hour ago
is there a better way of approaching this or is it even possible?