1 Reply Latest reply on Mar 17, 2010 9:39 AM by Flex harUI

    TextFlow <img /> problem !

    bornaeon Level 1

      Dear friends in Adobe,

      There is a simple question here:

      When we are using textFlow in our project, and when we want import some html tags in it, specially when our textFlow obj. is in a Module, for example:


      <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/halo" 
           layout="absolute" width="100%" height="100%"
           creationComplete="func();">
          
      
           <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) here -->
           </fx:Declarations>
           
           <fx:Script>
                <![CDATA[
                
      
                import flashx.textLayout.conversion.TextConverter;
                internal var Pvar:String = new String();          
      
                public function func():void{          
                     Pvar = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'>"+
                            "<div><span color='#ff0000'>some text here</span><br />"+
                            "<div><img id='img1' source='Sunset.jpg' /></div>"+
                            "</div></TextFlow>"
                     rtxt.textFlow= TextConverter.importToFlow(PoetsBCvar2, TextConverter.TEXT_LAYOUT_FORMAT);               
                }
      
                ]]>
           </fx:Script>
      
      
           <s:RichText id="rtxt" />
      
      </mx:Module>
      
      


      everything is allright, except showing the image file !

      and it will shown if we set both of width and height attributes in the <img... tag, just like this:


      ...
      "<div><img id='img1' source='Sunset.jpg' width='100' height='100' /></div>"
      ...
      


      I wonder if it could show the image without setting these attributes in default size, that was not so better and easier?!