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?
Comments
tag and that you close the
tag.
Seems like the V2 component contain several bugs and haven't been tested very well before releasing them.
Hope that helps.
Christophe
by cherreman on 2004-12-28 09:42:09
Thanks for the suggestion. I tried it, but alas, the scrollbar/thumb is still initializing incorrectly. I even went through an diffed all my base classes in mx.core.* and mx.controls.TextArea, etc. to make sure that *I* didn't mess something up while in one of these files and they all diffed perfectly with the original copies in FirstRun.
I'm going to try and see if SWFs behave differently but I'm not very optimistic that they will.
by Aral Balkan on 2004-12-28 11:39:32
If you cannot re-write the HTML yourself (if you look at the HTML Flash textfields generate, it's abhorrent), then yeah, invalidate till the cows come home. I've always been lucky with 3 onEnterFrames; your milage may vary.
by JesterXL on 2004-12-28 15:27:02
by mike on 2006-06-05 01:42:09
by jeroen on 2006-11-17 20:25:44
by mark on 2007-05-09 15:49:33
by mark on 2007-05-09 15:52:36
by Andrew Paul Simmons on 2007-10-12 22:32:08
by Ralph on 2008-08-05 10:49:16
by epox on 2008-09-07 19:07:43
by Paul on 2009-04-16 07:42:54
by Jamie on 2009-05-14 05:20:53
by Ry on 2009-06-03 18:52:02
by Paul on 2009-05-26 13:04:30
by Gabriela Portilla on 2009-07-03 22:37:12
by civali on 2009-07-18 14:50:27
by MYO on 2009-08-27 00:07:17
by dipan on 2010-06-04 09:58:30