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.