--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > You don't need to build an editor. The RTE builds a string that is sure > to be consumable by the htmlText property. You encode the output of > that component before you save it.
I don't think you're understanding the problem. Let's start at the beginning, since I know I hate long posts and I've deliberately avoided making this situation into a marathon, but I guess it is necessary at this point. We have an external XML file on the local hard drive that needs to have embedded HTML in it. That file is read in by a "container" program and passed in through ExternalInterface. When it passes through ExternalInterface, the string that comes in has either carriage returns or new lines wrapped around the HTML tags. I can defeat this by changing all <'s in the string to > prior to feeding them through. However, once they get on the other side those > s are all identical <'s. I have not been able to determine a way to figure out which "<"'s are part of HTML tags and which are not, so I don't have any way to encode just the right ones in the string before it goes into the XML function. The XML function then puts carriage returns or new lines around the HTML tags. The above is what happens if I wrap the text inside the node with CDATA, which is supposed to tell any XML parser not to pull this kind of crap with the enclosed text. So clearly CDATA doesn't help much. It also gets passed right on as part of the valueOf function, so it's just something else to strip out. However, when you leave CDATA off but the XML tags in, valueOf doesn't give you the value of the XML node, but the entire node. So there is no way at that point to get Flex to give me "just that stuff in between the opening and closing tags of the XML nodes." So, I need a solution that will pass the "double gateway" of the ExternalInterface/XML() AND that will not add extra lines to the data AND that can be retrieved by valueOf() AND that I don't have to strip a bunch of junk off AND that will be human readable (which is the whole point of XML). A RichText Control will not work for the following reasons: 1) It still doesn't give me anything that can pass the "double gateway". I need to be able to hand-write a file that will work before I could come up with an algorithm that can produce it. 2) The data still has to pass to the parent application, where it will probably get mangled again by ExternalInterface. An embedded swf cannot write to the hard drive. I suppose I could create an AIR editor, but again that is more complexity that shouldn't be necessary and only is because the XML() function is broken! 3) An editor involves a lot of extra tasks, including selecting which XML file on the hard drive we are working with. I do appreciate your help. I also am aware that when an inexperienced person presents you with their version of the solution and asks "how do I do that" and there is an established solution for something similar it is very tempting to point them to the established solution. However, it is also possible to answer "If you really want to do that you can do x, but I'd suggest you take this other approach." That way, if the person really needs to do it they have the information to do it, even if what they want to do turns out to be wrong. Thanks; Amy

