Skip to main content
Inspiring
June 19, 2011
Answered

how to create default's attributes for the links element?

  • June 19, 2011
  • 1 reply
  • 808 views

Hi

I propose you this example:

<TextFlow

paddingBottom="4" paddingLeft="4"

paddingRight="4" paddingTop="4"

whiteSpaceCollapse="preserve"

xmlns="http://ns.adobe.com/textLayout/2008">

<p color="#990099" fontSize="15"><a href="http://www.Google.com" target="_blank"><linkActiveFormat><TextLayoutFormat color="#0000cc" fontWeight='bold' textDecoration="none"/></linkActiveFormat><linkHoverFormat><TextLayoutFormat color="#cc0000" fontWeight='bold' textDecoration="none"/></linkHoverFormat><linkNormalFormat><TextLayoutFormat color="#00cccc" fontWeight='bold' textDecoration="none"/></linkNormalFormat><span>this is a link to google</span></a></p></TextFlow>

to be able to assign the attributes to the link I have had all of them among the tags <a> and if I want to add a link, for example to yahoo, I have to write:

<p color="#990099" fontSize="15"><a href="http://www.Yahoo.com" target="_blank"><linkActiveFormat><TextLayoutFormat color="#0000cc" fontWeight='bold' textDecoration="none"/></linkActiveFormat><linkHoverFormat><TextLayoutFormat color="#cc0000" fontWeight='bold' textDecoration="none"/></linkHoverFormat><linkNormalFormat><TextLayoutFormat color="#00cccc" fontWeight='bold' textDecoration="none"/></linkNormalFormat><span>this is a link to yahoo</span></a></p>

and so street for every link, and the lines increase to excess.

does exist the possibility to assign the attributes only one time in the flow, so that all the present links uses them as proper?

thanks for any answer

This topic has been closed for replies.
Correct answer Jin-Huang

For now, external/internal stylesheet is not supported by TLF. The flex examples you saw are based on flash.text.Stylesheet (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html), which is only for TextField, the classic text. So mx components in Flex support stylesheet while spark components don't.

1 reply

Adobe Employee
June 20, 2011

Just give the attributes to textflow as what the following markup does.

"<TextFlow paddingBottom=\"4\" paddingLeft=\"4\" paddingRight=\"4\" paddingTop=\"4\" whiteSpaceCollapse=\"preserve\" xmlns=\"http://ns.adobe.com/textLayout/2008\">" +
"<linkActiveFormat><TextLayoutFormat color=\"#0000cc\" fontWeight='bold' textDecoration=\"none\"/></linkActiveFormat><linkHoverFormat><TextLayoutFormat color=\"#cc0000\" fontWeight='bold' textDecoration=\"none\"/></linkHoverFormat><linkNormalFormat><TextLayoutFormat color=\"#00cccc\" fontWeight='bold' textDecoration=\"none\"/></linkNormalFormat>" +
"<p color=\"#990099\" fontSize=\"15\"><a href=\"http://www.Google.com\" target=\"_blank\"><span>this is a link to google</span></a></p>" +
"<a>aaaaa</a></TextFlow>";

Inspiring
June 20, 2011

thanks Jin-Huang

answered rapids, precise and correctly working.

I also thought about the possibility use of an external CSS  using the class StyleSheet, but I have found examples of application to textflow only in flex/mxml, that I don't know.

Do you know how to apply the stylesheet to a textflow in as3 x flash, and if yes you could do me or to point out an example?

thanks in advance

Inspiring
June 20, 2011

For now, external/internal stylesheet is not supported by TLF. The flex examples you saw are based on flash.text.Stylesheet (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/StyleSheet.html), which is only for TextField, the classic text. So mx components in Flex support stylesheet while spark components don't.


it seemed me to have read this information, but I didn't want to believe.

sin

hi