htmlText in a TextField w/Inline Images

I am creating a Web page with a simple 2-column layout, plus a header and a footer in Fl9/AS3. The content is HTML-formatted, loaded in from an XML file. The HTML contains inline JPGs and gets some styling from an external style sheet.

The content populates into TextFields with no problems, with the text wrapping the images. Here’s the problem: Because I don’t know at authoring time what the content will be, I must place the footer according to the height of the two columns. To determine the theoretical position of the footer, I add the y value of the larger column plus the height of the larger column plus 10.

When I publish out the SWF, the footer places higher than it should, intersecting and overlapping the columns. This is apparently because Flash calculates the height of the TextField based on some element other than what is rendered out. If I comment out the images in the HTML, the footer then places correctly. I stroked the TextField with the image in it; it stroked correctly. I tried a collision test with the TextField displaying the images. The hit registered up inside of the TextField, not where the border is rendered. This hit is approximately consistent with the faulty positioning of the footer.

Apparently, the height of the TestField is displaced not by the height of the images, but rather by the extra amount of space that the text takes to wrap the images–a different value, apparently. My next step is to attempt to compensate based on the area of the images. Although it would spare me a good deal of drudgery to have some method of determining the height of the TextField based on what is actually rendered out.

hey johnrobertlemon , i stumbled on the same issue as you, but apparently there is a pretty quick “fix” for this.
All you have to do is specify the width and height in the img tag. I made a short example explaining this here:
Hope it will help you if your still working on this. :slight_smile:

[Hey, thanks for the tip. I looked bck into my old files for this project, and I found this in the XML: <img id=“staff2” style=“width: 148px; height: 108px;” alt=“Staffing” src=“images/staff2a.jpg”>.

So it must have been something else. I ended up hard coding it to get the job done.

BTW, today I stumbled across this killer tween class: < http://blog.greensock.com/tweenliteas3/ >. It works great.

Thanks again.