1 Reply Latest reply on Jan 25, 2011 8:33 PM by FTQuest

    Inline TextLayoutFormat

    Gregory Lafrance Level 6

      I'm wondering how I can avoid having two TextLayoutFormat in the following code.

       

      I want to have an inline <s:TextLayoutFormat> tag, just not one for each <s:p>.

       

      I know I can do this other ways, but I'm trying to see how to do it this way.

       

      I tried putting a TextLayoutFormat in the <s:TextFlow> child tag <s:hostFormat> but the styles must be applied before the hostFormat is applied, and with inline MXML that will not be the case.

       

      Must be a way to do this.

       

       

      <?xml version="1.0"?>
      <s:Application
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:s="library://ns.adobe.com/flex/spark">
        <fx:Script>
          <![CDATA[
            import flashx.textLayout.formats.*;
          ]]>
        </fx:Script>
        <s:layout>
          <s:VerticalLayout paddingLeft="10" paddingTop="10"/>
        </s:layout>
        <s:TextArea editable="false" focusEnabled="false" width="430">
          <s:textFlow>
             <s:TextFlow>  
              <s:p>Please visit our blog at <s:a href="http://www.stardustsystems.com/blog">Stardust Systems Blog</s:a>
                <s:format>
                  <s:TextLayoutFormat color="0x0000FF" fontSize="14" 
                    fontFamily="Arial, Helvetica, _sans" 
                    paragraphSpaceBefore="10" paragraphSpaceAfter="20" 
                    typographicCase=
                      "{TLFTypographicCase.LOWERCASE_TO_SMALL_CAPS}"/>        
                </s:format>
              </s:p>
              <s:p>Please visit us at <s:a href="http://www.stardustsystems.com">Stardust Systems</s:a>
                <s:format>
                  <s:TextLayoutFormat color="0x0000FF" fontSize="14" 
                    fontFamily="Arial, Helvetica, _sans" 
                    paragraphSpaceBefore="10" paragraphSpaceAfter="20" 
                    typographicCase=
                      "{TLFTypographicCase.LOWERCASE_TO_SMALL_CAPS}"/>        
                </s:format>
              </s:p>
            </s:TextFlow>
          </s:textFlow>
        </s:TextArea>
      </s:Application>