PDA

View Full Version : making scrollbar work with dynamically created text fields


churowa
03-19-2005, 10:38 AM
I have a scrollpane that occupies the entire stage. The contentPath for the scrollPane is set as an object in the library, textMovieSymbol. This movie loads an xml file (text.xml), then renders all the fields of that xml file as text fields.

The problem is that the scrollPane doesn't scroll. The text fields are created, but they keep going out the bottom of the scrollPane, and nary a scrollbar appears.

From my review of the forums, I've come to the following conclusion:
- the scrollpane is created, and loads the textMovie
- since the textMovie is initially without any size, the scrollPane doesn't need scrollbars at first
- Once the textMovie has finished creating its text fields, the scrollpane doesn't realise that the size of the movie has changed, and as such doesn't create a vertical scrollbar. Even if I set the vscrollpolicy to 'on', it doesn't change anything. The scrollbar exists, but doesn't have any scrollability. (is that a word?)

I've included my code, so you can see what's going on. To make it work, add a scrollpane to the stage. Change the name of the scrollpane to myPane in the properties inspector. Make it width=500, height=400, x=0, y=0. set the contentPath=textMovieSymbol. If you then run it, it should show you what I've been talking about.

I'd appreciate some help figuring out how to make the scrollPane recognize the content in the movieclip, whether that means loading the movieClip before the scrollPane, or somehow refreshing the scrollpane's awareness of its contents (calling refresh() on the pane just reloads the movieClip, and doesn't seem to help).

Thanks in advance!

churowa
03-20-2005, 04:20 AM
noone knows what's going on here? can anyone point me to a thread?