1 Reply Latest reply on Jun 10, 2011 1:03 AM by Maxime Chupin

    CSS Style for an Import HTML file

    Maxime Chupin

      Hi,

       

      So I am trying to display HTML Text, but I wamt to apply a Style to my span tag.

      So I did something like that:

       

        <fx:Script>
          <![CDATA[
               import flashx.textLayout.conversion.TextConverter;
          ]]>
        </fx:Script>

       

        <fx:Declarations>
          <fx:String id="textFlowAsHTML" source="test.html" />
        </fx:Declarations>

       

        <s:RichEditableText id="code" editable="false" textFlow="{TextConverter.importToFlow(textFlowAsHTML, TextConverter.TEXT_FIELD_HTML_FORMAT)}"/>

       

      with test.html:


      <pre class="metapost">
        <span class="mp-ita">u</span>:=1<span class="mp-ita">cm</span>;
        <span class="mp-typ">path</span> <span class="mp-ita">p</span>;     <span class="mp-ita">p</span> := (0,0) -- (<span class="mp-ita">u</span>,0);
        <span class="mp-typ">pair</span> <span class="mp-ita">A</span>;     <span class="mp-ita">A</span> := (<span class="mp-ita">u</span>,-<span class="mp-ita">u</span>);
        <span class="mp-typ">numeric</span> <span class="mp-ita">a</span>;  <span class="mp-ita">a</span> := 90;
        <span class="mp-ins">drawarrow</span> <span class="mp-ita">p</span> <span class="mp-sty">withpen</span> pencircle <span class="mp-tra">scaled</span> 1<span class="mp-ita">bp</span>;
        <span class="mp-ins">drawarrow</span> <span class="mp-ita">p</span> <span class="mp-tra">rotatedaround</span>( <span class="mp-ita">A</span>, <span class="mp-ita">a</span> );
        <span class="mp-ins">drawarrow</span> <span class="mp-ita">p</span> <span class="mp-tra">shifted</span> -<span class="mp-ita">A</span> <span class="mp-tra">rotated</span> <span class="mp-ita">a</span> <span class="mp-tra">shifted</span> <span class="mp-ita">A</span>
          <span class="mp-sty">withpen</span> pencircle <span class="mp-tra">scaled</span> 1<span class="mp-ita">bp</span> <span class="mp-sty">dashed</span> withdots;
      </pre>

       

      I have a CSS file to define the behaviour of these span tags but I do not know how to use this file.

       

      Thanks for your help!