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 ofI 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
...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>
Copy link to clipboard
Copied
Thank you so much that was it!