Skip to main content
Participating Frequently
November 28, 2009
Question

selectors in style sheet for TLF?

  • November 28, 2009
  • 1 reply
  • 597 views

I'm having a little problem getting selectors in a StyleSheet to work properly in a TLF. Just curious if this is supported or isn't. Something like:

@11909012 tlf "flashx.textLayout.elements.*";

tlf|span
{
    fontSize:"30";
}

doesn't seem to work in build 12087. Also a second question: a styleName applied to  span seems to work fine, but not to a link. Is the only way to style a link through the FlowElement.linkActiveFormat, FlowElement.linkHoverFormat and FlowElement.linkNormalFormat? Thanks in advance,

This topic has been closed for replies.

1 reply

Adobe Employee
November 30, 2009

Flex doesn't support adding style sheet selectors for FlowElements, you can only add them to components. However, if you want this functionality you can do it yourself with some extra work by attaching an IFormatResolver that will make the connection between the stylesheet values and the FlowElement. If this is of interest, I can post some example code.

Can you explain what is not working about attaching a styleName to a link? If you could add some details about what actually happens, and what you expect to happen, that would help.

Thanks,

- robin

Participating Frequently
November 30, 2009

Any code would be very helpful. Thanks!

With regard to the links, I noticed that with the following two nodes declared in a TextFlow object

<s:span styleName="linkStyle">Some Text.</s:span>
<s:a styleName="linkStyle" href="http://www.adobe.com">A link.</s:a>

and the following style declaration:

<fx:Style>

        .linkStyle {
            color:"0xFF0000";
        }
       
</fx:Style>

Only the span is styled, not the LinkElement. Is the only way to style the LinkElement through the linkActiveFormat and the other properties? Thanks for the help, just trying to make sure I don't put anything inaccurate in the Flex 4 Cookbook.