Eddie
Eddie

Reputation: 939

RichEditableText - Mixed content is not allowed here

I am working on a Flex application that was recently upgraded from Flex 3 to Flex 4. I want to use the spark RichEditableText component to display some text with hyperlinks embedded in it but I'm having problems. I'm following the example here: http://help.adobe.com/en_US/flex/using/WS02f7d8d4857b1677-165a04e1126951a2d98-7ff3.html

Here is a simplified version of my component that still has the error

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
           xmlns:skins="skins.*"
           xmlns:annotations="annotations.*" xmlns:s="library://ns.adobe.com/flex/spark">

    <s:VGroup top="5" left="5">
        <s:RichEditableText id="richTxt" 
                            editable="false" 
                            focusEnabled="false">
            <s:textFlow>
                <s:TextFlow>
                    <s:p>
                        The following link takes you to: <s:a href="http://www.adobe.com">Adobe.com</s:a>
                    </s:p>
                </s:TextFlow>
            </s:textFlow>
        </s:RichEditableText>
    </s:VGroup>
</mx:Canvas>

My problem is that for every tag inside the TextFlow element FlexBuilder gives me the error "Mixed content is not allowed here". If I remove the tags inside the TextFlow element and just leave plain text things seem to work correctly. Google did not provide any insight into why I am getting this error. I am using the Flex 4.6 SDK. Any idea why I am getting that error and what I can do about it?

Upvotes: 1

Views: 745

Answers (1)

Eddie
Eddie

Reputation: 939

I came back to this problem and figured out the answer. I was using the wrong mx namespace. Since the application I am working on was upgraded to Flex 4 most components are still using the old 2006 mx namespace. It appears that in order to use the RichEditableText component I needed to switch to the new mx namespace. So, I removed the old mx namespace and replaced it with these:

 xmlns:mx="library://ns.adobe.com/flex/mx"
 xmlns:fx="http://ns.adobe.com/mxml/2009"

Upvotes: 1

Related Questions