• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Are new lines supposed to break Rich Text?

Engaged ,
Mar 18, 2010 Mar 18, 2010

Copy link to clipboard

Copied

Can you not enter linebreaks? When I do I get this error message:

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()


It looks like the element that it is choking on is "\n\t\t\t\t" in the first line break in the MXML:

    <s:RichEditableText x="93" y="22" editable="false">
        <s:TextFlow blockProgression="tb" columnCount="inherit" columnGap="inherit" columnWidth="inherit" locale="en_US" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="collapse" xmlns="http://ns.adobe.com/textLayout/2008"><s:p direction="ltr" paragraphEndIndent="0" paragraphSpaceAfter="0" paragraphSpaceBefore="0" paragraphStartIndent="0" textAlign="start" textAlignLast="start" textIndent="0" textJustify="interWord"><s:a color="#ae7c4b" fontFamily="Myriad Pro" fontSize="17" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="120%" textAlpha="1" textRotation="auto" trackingRight="2%" click="linkelement1_clickHandler(event)" textDecoration="none">{data.label}</s:a><s:span color="#cccccc" fontFamily="Myriad Pro" fontSize="17" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="120%" textAlpha="1" textRotation="auto" trackingRight="2%"> has posted</s:span><s:span color="#ae7c4b" fontFamily="Myriad Pro" fontSize="17" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="120%" textAlpha="1" textRotation="auto" trackingRight="2%"> </s:span><s:span color="#0099ff" fontFamily="Myriad Pro" fontSize="17" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="120%" textAlpha="1" textRotation="auto" trackingRight="2%">2 photos on Design Team</s:span></s:p></s:TextFlow>
    </s:RichEditableText>
TOPICS
Text layout framework

Views

583

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 18, 2010 Mar 18, 2010

I think you're missing the "textFlow" element. I tried this and it worked fine:

<s:Application name="school"

explicitMinWidth="100"

explicitMinHeight="100"

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

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

xmlns:mx="library://ns.adobe.com/flex/halo">

<fx:Script>

<![CDATA[

import flashx.textLayout.elements.LinkElement;

import flashx.textLayout.events.FlowElementMouseEvent;

import mx.controls.Alert;

public var data:Object;

protected function linkelement1_clickHandler(e

...

Votes

Translate

Translate
Adobe Employee ,
Mar 18, 2010 Mar 18, 2010

Copy link to clipboard

Copied

I think you're missing the "textFlow" element. I tried this and it worked fine:

<s:Application name="school"

explicitMinWidth="100"

explicitMinHeight="100"

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

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

xmlns:mx="library://ns.adobe.com/flex/halo">

<fx:Script>

<![CDATA[

import flashx.textLayout.elements.LinkElement;

import flashx.textLayout.events.FlowElementMouseEvent;

import mx.controls.Alert;

public var data:Object;

protected function linkelement1_clickHandler(evt:FlowElementMouseEvent):void {

var linkEl:LinkElement = evt.flowElement as LinkElement;

Alert.show("The '" + linkEl.getFirstLeaf().text + "' link would have gone to " + linkEl.href + " in a " + linkEl.target + " window, but it was cancelled.", "Fun with hyperlinks");

evt.stopImmediatePropagation();

evt.preventDefault();

}

]]>

</fx:Script>

<s:RichEditableText x="93" y="22" editable="false"><s:textFlow>

<s:TextFlow blockProgression="tb" columnCount="inherit" columnGap="inherit" columnWidth="inherit" locale="en_US" paddingBottom="inherit" paddingLeft="inherit" paddingRight="inherit" paddingTop="inherit" verticalAlign="inherit" whiteSpaceCollapse="collapse" xmlns="http://ns.adobe.com/textLayout/2008">

<s:p direction="ltr" textJustify="interWord"><s:a color="#ae7c4b" fontFamily="Myriad Pro" fontSize="17"  trackingRight="2%" click="linkelement1_clickHandler(event)">{data.label}</s:a><s:span color="#cccccc" fontFamily="Myriad Pro" fontSize="17" trackingRight="2%"> has posted</s:span><s:span color="#ae7c4b" fontFamily="Myriad Pro" fontSize="17"  trackingRight="2%"> </s:span><s:span color="#0099ff" fontFamily="Myriad Pro" fontSize="17"  trackingRight="2%">2 photos on Design Team</s:span></s:p>

</s:TextFlow>

</s:textFlow>

</s:RichEditableText>

</s:Application>

- robin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 19, 2010 Mar 19, 2010

Copy link to clipboard

Copied

LATEST

Thank you so much that was it!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines