Copy link to clipboard
Copied
Hi folks...
There is problem here:
I have something like this in my RichEditableText's textFlow:
str = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>"+"<div><tab/>" +
"<span fontFamily='tahoma' fontSize='12' color='0xc08057'>text specific word text</span></div>"+"</TextFlow>";
RichEditableText.textFlow=TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT);
I want to use replace() func, just like this:
var myPattern:RegExp = new RegExp(TextInput.text,"gi")
str = str.replace(myPattern,"<span backgroundColor='#c17e56' color='#dec59d'>"+TextInput.text+"</span>");
RichEditableText.textFlow= TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT);
But after doing this, my specific word that I had been written in my TextInput, would'nt be appear inside of my text. I think because of another <span> in the main text. the result is something like this:
<span fontFamily='tahoma' fontSize='12' color='0xc08057'>
text <span backgroundColor='#c17e56' color='#dec59d'>specific word</span> text
</span>
how can I fix this?!
Copy link to clipboard
Copied
The problem is that a TLF span doesn't map to an HTML span which does support nesting. What's needed is
a new element - "SubParagraphGroupElement" that can have text, tlf type spans and other SubParagraphGroups as children.
One awful hack would be to turn all the outer span's into tcy's which will have no effect unless you are doing vertical text. That gives you exactly one level of nesting - probably worse than useless. Anyhow it would look like this:
<p>
<tcy fontFamily='tahoma' fontSize='12' color='0xc08057'>
text <span backgroundColor='#c17e56' color='#dec59d'>specific word</span> text
</tcy>
</p>
The more people that agitate for a SubParagraphGroupElement the better. It's a hard sell and keeps falling off the plans.
Richard
Copy link to clipboard
Copied
TanQ for ur reply dear richard,
I tested that, but there is an other problem.
I could use textAlign='justify' in my <span />, but in <tcy /> seems that it doesn't work!
how can I do that?!
Copy link to clipboard
Copied
textAlign has no effect when applied to a SpanElement. textAlign only has effect on the ParagraphElement. Must be something else going on with your code.
Richard