Skip navigation
Mikhail Shevchuk
Currently Being Moderated

TextFlow height and Flex SDK 3.5

Mar 19, 2010 7:31 AM

Hello, forum

 

Thank you very much for the possibility to use TextFlow in Flex 3. I'm using the technique as Mihai Corlan by doing the following thing:

There is a TextFlow instance and a ParagraphElement added to it.

var p : ParagraphElement = new ParagraphElement();
span.text = 'Disc VERBATIM DVD+RWs 4x Jewel Case 5';
p.addChild(span);
_textFlow.addChild(p);

 

The TextContainer is a Sprite and it is added as canvLabel.rawChildren.addChild(_textContainer); into the Flex Canvas.

<mx:Canvas id="canvLabel" height="80" width="100%" >
</mx:Canvas>

 

What I am trying to implement is to resize the Canvas automatically to fit the TextFlow. How can this be done?

How can I define the height of the TextFlow that was put into my Canvas and automatically detect the correct height for the Canvas?

If I set the Canvas height to 100% nothing is showed. I guess in Gumbo the Container is automatically resized due to TextFlow's height but how this can be implemented in Flex 3.5 ?

 

Thanks in advance,

Mikhail Shevchuk

 
Replies
  • Currently Being Moderated
    Mar 19, 2010 9:28 AM   in reply to Mikhail Shevchuk

    You will need to follow the recipe in the "creating custom components"

    chapter in the documentation and use UIComponent instead of a Sprite.

     

    If you get lost, look at the Flex 4 code for help.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points