thanks for the input it really helped! I'm including a simplified version
snippet of my code, it may help someone...
for(var x:int = selectedTextStart; x <
activeFlow.textLength; x++){
var t:String =
activeFlow.getText(x,x+textToSearch.length);
if(t == textToSearch){
var editManager:EditManager = new
EditManager( new UndoManager() );
activeFlow.interactionManager =
editManager;
activeFlow.flowComposer.updateAllControllers();
selectedTextStart = x;
selectedTextEnd = x +
textToSearch.length;
editManager.selectRange(
selectedTextStart,selectedTextEnd);
if(searchCommand == "replace" ||
searchCommand == "replace_and_search"){
editManager.insertText(
replaceText);
selectedTextStart = x +
replaceText.length;
}
if(searchCommand != "replace_all"){
break;
}
}
}
Thanks!!
Carlos
-----Original Message-----
From: Harbs [mailto:[email protected]]
Sent: Tuesday, January 06, 2015 9:42 AM
To: [email protected]
Subject: Re: find and replace strings in TextFlow class
1. Determine the location of the text within the string that you want to
replace.
2. Determine the end location.
3. Create a SelectionState with those values as anchor and active positions.
4. Use EditManager.insertText() and supply the new text string and selection
state.
Harbs
On Jan 6, 2015, at 12:28 AM, Carlos Cruz <[email protected]> wrote:
> I'm trying to create search and replace a string logic for TextFlow
text.
> Can anyone offer some input / advice on finding the start and end
> position of a string in the TextFlow elements and replace it .
>
>
>
> I am able to convert the TextFlow contents into a string and use
> string methods and Regex patterns.
>
>
>
> Thanks!!
>
> Carlos
>
>
>
>
>