TextArea + HTML + Images == hell?
Can someone please confirm that the TextArea component's scrollbar becomes completely useless when displaying HTML content with images? It bears no relation to the amount of content in the TextArea and the thumb is set to the wrong size. Please, someone tell me I'm not losing my mind! Anyone?
Update: To narrow it down - The scrollbar works correctly when there is one image in the HTML but not when there are two or three.
Update: This is really weird: Same content, 2 different FLAs: The TextArea gets messed up. Another FLA, works perfectly. I'm trying to narrow this down and will report back when I have something. So far, whether or not the TextArea is standalone or part of another movie clip and whether or not it is placed on Stage or attached at runtime do not affect the results.
Update: This is a time-related issue. In identical FLAs, loading the same HTML into the same TextArea component, if I set the frame rate from 1-5 fps, the thumb initializes incorrectly, from frame rate 6 onwards, it initializes correctly. However, it's not just the frame rate but related to the amount of processing that Flash is doing at the time (and hence a time-related issue) as I've seen this happen on a SWF running at 31fps when the textarea is populated at a processor intensive time.
I'm going to start looking for a workaround to force the TextArea to recalibrate itself... I have a few ideas...
Update: Here's the workaround: You need to call myTextArea.invalidate() after you're sure that it has initialized fully with the content. (This causes the TextArea to recalculate everything and redraw itself.) Unfortunately, we don't have any sort of event to listen for that tells us when the TextArea has completely initialized with new content so this becomes mostly guesswork. In my test FLA, calling invalidate() 1 second after setting the text property of the TextArea sufficed at 2fps (at 1fps, 1500 was the minimum that worked.) Of course, this is all time-based so will change depending on how long it takes the TextArea to initialize and that's based on a number of factors including the processor load at the time and the performance of the client machine.We can file this one under Flash Voodoo, don't you think?