PDA

View Full Version : Mysterious text display problem


Rhino
09-06-2006, 06:25 PM
OK, so I have been working on this problem all week and I cannot resolve it to save my life. Someone out there has got to know why this is happening. To view the problem please follow these directions:

1. open a browser with flash 8 installed and go here (http://www.wholelattelove.com/esp_index.cfm)
2. click "Launch Espressomatic". you have to allow popups for this to work.
3.once everything loads, click on the Jura Capresso Impressa - should be the second item from the top on right-hand menu.
4. click "reviews". the first review should display in the content pane.

OK, this is the issue I'm having. The text is pulling out of the database, going where it needs to go, and applying styles correctly. However, the scrollbar is acting wierd. If you scroll to the bottom of the text, it looks like you have reached the end but if you put the cursor into the textfield and hit ctrl+A to select all, you will see that there is several more lines of text in there underneath the scroller. I cannot get this thing to scroll all the way down and it's about to drive me batshit. ANY thoughts or ideas would be appreciated.

-Rhino

Kraken
09-06-2006, 06:42 PM
try calling the scrollbar's redraw() method after the text has fully loaded and the styles have been applied.

Rhino
09-06-2006, 06:48 PM
already tried that, and it does exactly nothing. Right now I'm using a TextArea component to display the text. I tried invalidate() and redraw() before and after I populate the text with no result. Before I put in the textarea I was using a dynamic text box with a UIScrollbar and it was doing basically the same thing. I don't understand this...I've never seen Flash do anything like this before and deadlines are creeping up fast. Any more ideas?

-Rhino

Kraken
09-06-2006, 08:55 PM
Hmm...I think it's gotta be something to do with the stylesheets...like Flash is setting the scroll before the text gets style and the lines move down. Where are you setting the style? Is it before or after pushing the text into the textfield?

Rhino
09-06-2006, 10:39 PM
As usual, you are completely correct Kraken. After troubleshooting most of the afternoon I narrowed the problem down to the stylesheets, which I am loading externally and applying to the text box. The dynamic text box in Flash was set to a default text size of 10 px, so the text pulled from the dbase was being inserted at 10px then styled to 12px with the CSS. What I think was happening was the text was populated and the scrollbar rendered, then the CSS was being applied after everything was rendered for 10px type ( the CSS makes headers bigger, so it increases the length of the text box and pushed everything down).

The workaround I implemented is very kludgy. All I did was set the default text size in Flash to 22px. Now, the textbox sized for 22px text and is shrunk by the CSS. This basically gives me the effect I need, and it works for now. However I know there has got to be a better way to do this. Let me know if you think of anything.

EDIT: to answer your question, I was setting the style before I pushed the text in but I don't think it was happening in that order at runtime.

-Rhino