Could you just use "indexOf" or RegExp to find the positions of the Strings in
Flash instead?
http://keithhair.com/web/highlight/highlight.swf
What is the reason to get the position from Coldfusion instead of Flash?
private function highlightText():void
{
var str:String=mylist.itemToLabel(mylist.selectedItem);
var b:int=mytextarea.text.toLowerCase().indexOf(str);
var e:int=b+str.length;
if(b > -1 && e > b){
mytextarea.setFocus();
mytextarea.setSelection(b,e);
}
}
-- Keith H --
riel Jakobovits wrote:
> i am returning an array of text snippets from coldfusion, and with each
> snippet, I am returning the position where that snippet is found in the whole
> body of text.
>
> in flex, I am putting the whole body of text in a text area and am putting
> the snippets in a List.
>
> I am trying to set it up so that when I click a snippet in the list, the
> snippet in the body of text is hilited. However this is not working. In
> coldfusion, a new line character counts as a character. In a text area, it
> does not seem to. So my hiliting is always off by the number of newlines
> found in the text body before the snippet being hilited.
>
> What I am thinking I could do is, in cold fusion, offset the returned index
> by the number of newline chars cold fusion can find before the snippet. To do
> this I would replace all newlines{2,} with one newline and then ListLen()
> using newline as a delimiter up to the start of the snippet then say curIndex
> - ListLen().
>
> Thoughts? Ideas?
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>