1 Reply Latest reply on Mar 15, 2010 2:54 PM by Peter deHaan

    TextFlow problems in latest Stable Builds of gumbo SDK (4.0.0.13875)

    bornaeon

      1) It is simple code in Flash Builder 4 beta 2 with defaut sdk, that works well:

          

           <s:RichText>
                <s:TextFlow>
                     some text here...
                </s:TextFlow>
           </s:RichText>


      But when I set my sdk to latest stable one (flex_sdk_4.0.0.13875); after running project, I see this error:

      ArgumentError: NewElement not of a type that this can be parent of
          at flashx.textLayout.elements::FlowGroupElement/replaceChildren()[C:\Vellum\branches\v1\1.0\ dev\output\openSource\textLayout\src\flashx\textLayout\elements\FlowGroupElement.as:772]
          at flashx.textLayout.elements::FlowGroupElement/set mxmlChildren()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\text Layout\elements\FlowGroupElement.as:184]
          at flashx.textLayout.elements::TextFlow/set mxmlChildren()[C:\Vellum\branches\v1\1.0\dev\output\openSource\textLayout\src\flashx\text Layout\elements\TextFlow.as:566]
          at spark.components::RichText/createTextFlowFromContent()[E:\dev\4.0.0\frameworks\projects\s park\src\spark\components\RichText.as:1226]
          at spark.components::RichText/commitProperties()[E:\dev\4.0.0\frameworks\projects\spark\src\ spark\components\RichText.as:999]
          at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
          at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:700]
          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]

      Am I doing something wrong?!



      2) I have a simple code for textFlow that have a <s:format> tag in it.

      in Flash Builder 4 beta 2 with defaut sdk all things are right, but when I set my sdk to latest stable one (flex_sdk_4.0.0.13875), I have no error, but my format settings do not implement in my text!

      Is there any changes for this in latest sdk?!

      the code is here:


           <fx:Script>
                <![CDATA[
                     import flashx.textLayout.conversion.TextConverter;           
                 
                     var str:String="<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><format id='B_Tilte' color='#ff0000' fontWeight='bold' /><div format='B_Tilte'>some text here...</div>";
                 
                ]]>
           </fx:Script>
         
           <s:RichText  fontFamily="Tahoma" id="richtext1" textFlow="{TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT)}" direction="rtl"  />

        • 1. Re: TextFlow problems in latest Stable Builds of gumbo SDK (4.0.0.13875)
          Peter deHaan Level 4

          (1) Try setting the TextFlow object to the textFlow property instead of using the default content property:

          <?xml version="1.0"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx">

             

              <s:RichText>
                  <s:textFlow>
                      <s:TextFlow>
                          some text here...
                      </s:TextFlow>
                  </s:textFlow>
              </s:RichText>
             
          </s:Application>

           

           

          (2) I believe you forgot to close the </TextFlow> in your string:

          <?xml version="1.0"?>
          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx">
             
              <fx:Script>
                  <![CDATA[
                      import flashx.textLayout.conversion.TextConverter;
                     
                      protected const str:String="<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><format id='B_Tilte' color='#ff0000' fontWeight='bold' /><div format='B_Tilte'>some text here...</div></TextFlow>";
                     
                  ]]>
              </fx:Script>
             
              <s:RichText  fontFamily="Tahoma" id="richtext1" textFlow="{TextConverter.importToFlow(str, TextConverter.TEXT_LAYOUT_FORMAT)}" direction="rtl"  />
             
          </s:Application>

           

          Peter