0

For some reason, if you add an image to htmlText, like the following:

myText.htmlText = "<img src='"+dataProvider.bodyImage.getUrl('original')+"' align='left' \/>" + dataProvider.bodyText;

The image will be succesfully added to the htmlText, but it seems to measure the sizes completely wrong. At times, the actual text (dataProvider.bodyText) will have part 'hidden' under the image. At other times, there are anywhere from 1 to 4 lines cut off at the bottom. However, if you select the text and drag your mouse down, you can see the bottom lines. It appears the text is all there, but the mx:Text component is not including the image in the textHeight, so it doesnt resize the componenet to the correct size.

Any ideas?

Currently using: Flex 3 (cannot upgrade to 4, unfortunately).

Thanks so much!

andrewpthorp
  • 4,998
  • 8
  • 35
  • 56
  • My _guess_ would be that htmlText expects text, so it wasn't programmed to deal with an image height. Perhaps you can manually add the image height to the control yourself after you've populated it. – Michael Todd Feb 16 '11 at 16:29
  • Yeah, I don't think that is correct - they say they 'support' the img tag in htmlText, so it would seem there is some way to override the measuring - or something - to get it to calculate correctly. – andrewpthorp Feb 16 '11 at 16:54
  • You've got another question on this same topic... My answer there should help you with this too. – bug-a-lot Feb 17 '11 at 16:18

1 Answers1

0

The key is you have to specify the width/height of the image in htmlText in order for it to be calculated correctly (or close to it, anyway).

andrewpthorp
  • 4,998
  • 8
  • 35
  • 56