Skip to main content
Participant
January 25, 2010
Question

TextFlow is getting cropped, How to fix that?

  • January 25, 2010
  • 1 reply
  • 920 views

im getting the text from an external XML file:

<page>
            <name><![CDATA[ <h1>2. The female sex hormones</h1>]]></name>
            <subName><![CDATA[ <h2>2.1 Estrogens</h2>]]></subName>
             <thumb>images/MOD1/Mod 1-Tab. 2.1-SMALL.png</thumb>
             <imgBIG>images/MOD1/Mod 1-Tab. 2.1.png</imgBIG>
             <image></image>
             <detailsURL>http://www.prescript.co.uk </detailsURL>
             <description></description>
            <!--<description>
            <![CDATA[
            <p>The estrogens are a class of hormone.  The three most important estrogens are <a href="#" class="glossaryLink">estrone</a>, <a href="#" class="glossaryLink">estradiol</a> and <a href="#" class="glossaryLink">estriol</a> These are often referred to as E<font face="ArialSub">1</font>, E<font face="ArialSub">2</font> and E<font face="ArialSub">3</font> respectively.  Estradiol is the most potent and the most important component of HT while estriol is the weakest and least important.  One type of estrogen can be converted to another type in the body.</p><br></br>
            <p>Estradiol – also known as 17β-estradiol – is the key ingredient in the Estradot patch. More details can be found in Module 2 – Estradot: the product</p>
            ]]>
            </description>-->
            <tag><![CDATA[<p class="title-text">Table 2.1 The three main naturally occurring estrogens</p>]]>
            </tag>
            <!-- Text Layout-->

           <txtLayout>
                <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"  fontFamily="Arial" fontSize="12" textAlign="left">
            <p>The estrogens are a class of hormone.  The three most important estrogens are <a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#">estrone</a>,<a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#">estradiol</a>, and <a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#" >estriol</a>.  These are often referred to as E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">1</span>, E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">2</span> and E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">3</span> respectively.  Estradiol is the most potent and the most important component of HT while estriol is the weakest and least important.  One type of estrogen can be converted to another type in the body.<br></br><br></br>Estradiol – also known as 17β-estradiol – is the key ingredient in the Estradot patch. More details can be found in Module 2 – Estradot: the product</p>
                </TextFlow>
            </txtLayout>

            <txtLayoutX>0</txtLayoutX>
            <txtLayoutY>86</txtLayoutY>
            <txtLayoutW>705</txtLayoutW>
            <!-- FIGURES-->
            <fig></fig>
            <figX></figX>
            <figY></figY>
            <figW></figW>
            <pagetitleX>0</pagetitleX>
            <pagetitleY>20</pagetitleY>
            <pagetitleW>550</pagetitleW>
            <subNameX>0</subNameX>
            <subNameY>56</subNameY>
            <subNameW>550</subNameW>
            <thumbX></thumbX>
            <thumbY>220</thumbY>
            <imgX></imgX>
            <imgY></imgY>
            <descX>0</descX>
            <descY>106</descY>
            <descW>705</descW>
            <tagX>0</tagX>
            <tagY>200</tagY>
            <tagW>550</tagW>
            <swfX></swfX>
            <swfY></swfY>
            <swfW></swfW>
        </page>

in Flash :

function createTxtLayout(X, Y, W, TXT)
{
    //trace("Pages ------- createTxtLayout");
    var TXTLayout:TextLayout;
    var containerFormat:ContainerFormat;
    //containerFormat.columnCount            = 1;
    //containerFormat.columnWidth            = W;
    var xmlTXT:XML;
    xmlTXT                                = XML(TXT);
    TXTLayout                             = new TextLayout()
    addChild(TXTLayout);
    //TXTLayout.getChildAt(2).width        = 705;
    TXTLayout.xmlText                    = xmlTXT;
    TXTLayout.x                            = X;
    TXTLayout.y                            = Y;
   
    for(var i=0;i<TXTLayout.numChildren;i++)
    {
        trace("child "+i+ "is"+ TXTLayout.getChildAt(2).width);
    }
}

Im desperate for a solution, i have tried adding columnWidth="705" columnCount="1" without any luck. when i trace TextLayout 3rd child which is a Sprite i get 550 as width.i wana be able set the width of the textLayout to 705px.

When i select the text and drag i can see the rest of the text,so it looks like theirs a mask on top.

Any Suggestions?

This topic has been closed for replies.

1 reply

Adobe Employee
January 26, 2010

If you only want one column, you should be able to leave the columnWidth and columnCount unspecified. You will get one column (the default) and it will fit the width of the container it is in. I'm not sure what application you are using (Flex or Flash), but if its Flash, then associated with the TextFlow is a flowComposer. The flowComposer should have a controller (possibly more than one), and the controller will have a compositionWidth. That width is the width that is available for laying out text. Sounds like you want that to be 705. You can reset it by calling controller.setCompositionSize(newWidth, newHeight).

Participant
January 26, 2010

Cheers mate, I am using Flash the TextFlow is set in an external XML file so how i would be able 2 instantiate it so that i use the flowComposer:

//External XML document

.

.

.

.

<txtLayout>
                <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"  fontFamily="Arial" fontSize="12" textAlign="left">
            <p>The estrogens are a class of hormone.  The three most important estrogens are <a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#">estrone</a>,<a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#">estradiol</a>, and <a  STYLE="text-decoration:none" fontWeight="bold" color="#ec008c" href="#" >estriol</a>.  These are often referred to as E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">1</span>, E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">2</span> and E<span baselineShift="subscript" fontSize="14" fontLookup="embeddedCFF">3</span> respectively.  Estradiol is the most potent and the most important component of HT while estriol is the weakest and least important.  One type of estrogen can be converted to another type in the body.<br></br><br></br>Estradiol – also known as 17β-estradiol – is the key ingredient in the Estradot patch. More details can be found in Module 2 – Estradot: the product</p>
                </TextFlow>

</txtLayout>

.

.

.

//Create TextLayout function

.

.

.

var xmlTXT:XML;
xmlTXT                                = XML(TXT); //TXT would be the txtLayout node that has been loaded dynamicaly and passed to this createTxtLayout function

TXTLayout                            = new TextLayout()
addChild(TXTLayout);

TXTLayout.xmlText                = xmlTXT;

Thanks a lot

Adobe Employee
February 2, 2010

Not sure what you did to create the TextFlow, but a flowComposer is just a property of the TextFlow.So presumably you would get the TextFlow from your TextLayout object, and once you have it you can access the flowComposer. I'm more conversant with how this works in Flex, so you may have to hunt around a little -- sorry!

- robin