3 Replies Latest reply on Aug 28, 2008 7:26 PM by Newsgroup_User

    html format issue

    mlecho
      In this Flex project i am loading a stylesheet wiht the following styleName
      .imageDescription
      {
      font-family:'Regular';
      font-size:14px;
      leading:-5px;
      color:#717171;
      }

      i load in via XML , one of many XMLLists:
      <text_copy targetid="img_2">
      <h:p class='imageDescription'>This is a list tag<font face='Regular' color='#ff0000'>BREAKING TEXT</font><br/><a href='event: http://www.website.com'><font face="Light" color='#005568'>Learn More &gt;</font></a></h:p>
      </text_copy>

      for some reason, if i add the font tags to where you see BREAKING TEXT above, that set of words breaks to the next line! What gives? The formatting is fine, but it should not break. Any thoughts....below is the method adding this text:
        • 1. Re: html format issue
          Level 7

          "mlecho" <webforumsuser@macromedia.com> wrote in message
          news:g96sel$fsg$1@forums.macromedia.com...
          > In this Flex project i am loading a stylesheet wiht the following
          > styleName
          > .imageDescription
          > {
          > font-family:'Regular';
          > font-size:14px;
          > leading:-5px;
          > color:#717171;
          > }
          >
          > i load in via XML , one of many XMLLists:
          > <text_copy targetid="img_2">
          > <h:p class='imageDescription'>This is a list tag<font face='Regular'
          > color='#ff0000'>BREAKING TEXT</font><br/><a
          > href='event: http://www.website.com'><font face="Light"
          > color='#005568'>Learn
          > More ></font></a></h:p>
          > </text_copy>
          >
          > for some reason, if i add the font tags to where you see BREAKING TEXT
          > above,
          > that set of words breaks to the next line! What gives? The formatting is
          > fine,
          > but it should not break. Any thoughts....below is the method adding this
          > text:

          Look at prettyPrinting, prettyIndent, ignoreWhiteSpace for the XML object
          (not the instance, but the overall class).

          HTH;

          Amy


          • 2. Re: html format issue
            mlech0
            thanks amy, i looked there, no luck
            i am attaching a super simplified example of what's happening. The goal is to get the html tags to behave exactly like that...as html tags

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute"
            creationComplete="init()">
            <mx:Script>
            <![CDATA[
            import mx.core.UITextField;
            private function init():void
            {
            var x:XML=XML(<t>
            <p class='imageDescription'>this is a test <font color='#ff0000'> this breaks</font>
            <a href='event: http://www.sdfds.com'><font color='#005568'> so does this</font></a>
            </p>
            </t>);
            var tf:UITextField= new UITextField()
            tf.width=400;
            tf.height=200;
            tf.multiline=true
            tf.wordWrap=true
            tf.border=true
            tf.htmlText=x.children().toString()
            trace()
            addChild(tf)
            }
            ]]>
            </mx:Script>

            </mx:Application>

            • 3. Re: html format issue
              Level 7

              "mlech0" <webforumsuser@macromedia.com> wrote in message
              news:g97h96$7lb$1@forums.macromedia.com...
              > thanks amy, i looked there, no luck
              > i am attaching a super simplified example of what's happening. The goal is
              > to
              > get the html tags to behave exactly like that...as html tags
              >
              > <?xml version="1.0" encoding="utf-8"?>
              > <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
              > layout="absolute"
              > creationComplete="init()">
              > <mx:Script>
              > <![CDATA[
              > import mx.core.UITextField;
              > private function init():void
              > {
              > var x:XML=XML(<t>
              > <p class='imageDescription'>this is a test <font color='#ff0000'>
              > this breaks</font>
              > <a href='event: http://www.sdfds.com'><font color='#005568'> so
              > does this</font></a>
              > </p>
              > </t>);
              > var tf:UITextField= new UITextField()
              > tf.width=400;
              > tf.height=200;
              > tf.multiline=true
              > tf.wordWrap=true
              > tf.border=true
              > tf.htmlText=x.children().toString()
              > trace()
              > addChild(tf)
              > }
              > ]]>
              > </mx:Script>
              >
              > </mx:Application>

              I don't see where you're setting the prettyPrinting, etc.? You also may
              want to wrap it in CDATA. See help for more details.