Skip to main content
December 22, 2010
Answered

Problem with simple list example

  • December 22, 2010
  • 1 reply
  • 1107 views

Hi,

I'm using Flex SDK 4.5.0.17855 (Fri Sep 24, 2010).

<?xml version="1.0"?>

<s:Application

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

    xmlns:s="library://ns.adobe.com/flex/spark"

    >


    <s:RichText>

        <s:TextFlow>

            <s:list>

                <s:li>item</s:li>

                <s:li>item</s:li>

                <s:li>item</s:li>

            </s:list>

        </s:TextFlow>

    </s:RichText>


</s:Application>

At runtime, this gives me the following error:

ArgumentError: NewElement not of a type that this can be parent of

at flashx.textLayout.elements::FlowGroupElement/replaceChildren()

at flashx.textLayout.elements::FlowGroupElement/set mxmlChildren()

at flashx.textLayout.elements::TextFlow/set mxmlChildren()

at spark.components::RichText/createTextFlowFromContent()

at spark.components::RichText/commitProperties()

at mx.core::UIComponent/validateProperties()

at mx.managers::LayoutManager/validateProperties()

at mx.managers::LayoutManager/doPhasedInstantiation()

at mx.managers::LayoutManager/doPhasedInstantiationCallback()

Any ideas what to do to get this to compile?

cheers,

Jan

This topic has been closed for replies.
Correct answer robin_briggs

It will work if you remove the TextFlow element, and make <list> a child of RichText. I think in this case the <RichText> is acting as a TextFlow, so if you put the TextFlow in you have one too many. Try this:

<s:RichText>

     <s:list>

          <s:li>item</s:li>

          <s:li>item</s:li>

          <s:li>item</s:li>

     </s:list> 

</s:RichText>

- robin

1 reply

robin_briggsCorrect answer
Adobe Employee
December 22, 2010

It will work if you remove the TextFlow element, and make <list> a child of RichText. I think in this case the <RichText> is acting as a TextFlow, so if you put the TextFlow in you have one too many. Try this:

<s:RichText>

     <s:list>

          <s:li>item</s:li>

          <s:li>item</s:li>

          <s:li>item</s:li>

     </s:list> 

</s:RichText>

- robin

December 23, 2010

Thanks Robin