import markup incl. linkNormalFormat/...
Hi there!
Importing a LinkElement via code is not a problem, but to set the linkNormalFormat/linkHoverFormat for it is an issue:
Via Code it works like this:
....
var linkNormalFormat:TextLayoutFormat = new TextLayoutFormat();
linkNormalFormat.color = 0xff0000;
var span:SpanElement = new SpanElement();
span.text = "This is a Test";
var linkElement:LinkElement = new LinkElement();
linkElement.linkNormalFormat = linkNormalFormat;
linkElement.addChild(span);
var paragraphElement:ParagraphElement = new ParagraphElement();
paragraphElement.addChild(linkElement);
textFlow.addChild(paragraphElement);
....
I tried to do implement the same structure in XML:
var xml:XML =
<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>
<p>
<a>
<linkNormalFormat><color>#ff0000</color><linkNormalFormat> <!-- I tried loads of possibilities, thats only one try ... -->
<span>TLF LINK</span>
</a>
</p>
</TextFlow>;
after importing that XML to the TextFlow I get the follow Error:
Error: Expected one and only one TextLayoutFormat in http://ns.adobe.com/textLayout/2008::linkNormalFormat
at BaseTextLayoutImporter/reportError()
at flashx.textLayout.conversion::TextLayoutImporter/createDictionaryFromXML()
at flashx.textLayout.conversion::TextLayoutImporter$/parseLinkNormalFormat()
....
Has anyone an idea why that happens, or has anyone already imported formatted links inside XML with TLF?
THANKS!!!
