1 Reply Latest reply on Jan 13, 2011 2:11 PM by ozDiGennaro

    Problem with TLF - floating an inline image

    ozDiGennaro Level 1

      I am running the latest version of Flash Builder 4 (4.0.1).  The problem that I having:

      When I use an InlineGraphicsElement if aTextFlow (in a RichEditableText component), if I set a value for the "float" attribute of an <img> element; the image is not visible.  Without the float attribute, I see the image.

       

      Is this a version problem with TLF?  How do I know which version of TLF that I'm using?  How do I install the correct version of TLF?

       

      Thanks for the help.

           Oz

       

       

      Some code fragments:

       

      The TextFlow string with "float":

      <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
      <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
      <p>

      <img float="left" width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>

      <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
      ...
      </div>

       

      Without "float":

      <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
      <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
      <p>

      <img width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>

      <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
      ...

      </div>

       

      A bit of MXML code:

       

          <s:Group id="myGroup" width="100%" height="100%">
              <s:RichEditableText id="myRichText" lineBreak="toFit">
              </s:RichEditableText>
              <!--- Do not set the height of the RichEditableText - since it seems to prevent the appearance of the vertical scroll bars -->
          </s:Group>

       

      And some Actionscript that adds components:

       

                  scroller = new SxScroller();
                  scroller.dx = dxScroller;
                  scroller.dy = dyScroller;
                  scroller.addEventListener(FlexEvent.CREATION_COMPLETE,scrollerEvent);
                  scroller.addEventListener(FlexEvent.UPDATE_COMPLETE,scrollerEvent);

       

                  richText = scroller.richText;
                 
                  richText.editable = false;  // textCharacter.enableEdit; // probably false.  TODO:  support true???
                  richText.selectable = true; // required
                 
                  richText.width = dxRichText;

       

      And finally the import of a TextFlow string:

       

      richText.textFlow = TextFlowUtil.importFromString(textFlowString, WhiteSpaceCollapse.PRESERVE);