Replace a keyword in string with a textBox
I'm probably thinking about this in the wrong way. My goal is to create an input textField in a position of a key word in a textField And update the position based on that key word
Example: The planet ANSWER is the 3rd farthest away from the sun. (I want the ANSWER keyword to generate a text field in the same posion within the question).
My problem is trying to find a consistent solution to a dynamic list of questions.
My code so far:
var str:String = "hi this is ANSWER a sample.";
var theText:TextField = new TextField();
answer.text = str;
addChild(theText);
theText.y = answer.y;
//!!!! my trouble spot !!!!//
theText.x = (answer.x+theText.text.length)+str.indexOf("ANSWER");
Thanks for any help or suggestions.
