tags:

views:

760

answers:

0

There are two issues with TextArea htmlText that I posted as single questions: embeded images and images aligning.

It's just impossible to solve this problem using only TextArea component.

One of the solutions is to use images layer over TextArea.

<mx:Canvas>
    <mx:TextArea id="content" width="100%" height="100%" />
    <mx:Canvas id="imgLayer" width="100%" height="100%" />
</mx:Canvas>

Then we can use:

content.textField.getCharBoundaries(charIndex);

So we can place images in right positions.

But there is a problem with a scrollbar. When the scrollbar appears, getCharBoundaries returns null for char positions that are not in (0, 0, width, height) area.

How to solve this problem? Any ideas how to combine TextArea with a scrollbar and Canvas with its images?