Scrollpane's scrollbar issue

Hello, I’m doing this:

my_sp.contentPath = “loader”; // loaded from the library (is this really necessary?)
var content_mc:MovieClip = my_sp.content;

…then I am looping through some arrays and attaching textfields and radio buttons to “content_mc”.

It all works except the vertical scrollbar isn’t appearing when it needs to. How do i update the visiblity of the scrollbar after ive dynamically attached my stuff? I only want it visible when it is necessary.

Thanks

edit: I’ve tried just manually setting the vScrollPolicy to “on” after the scripts that do the attaching run, but the scrollbar doesn’t scroll far enough?

edit edit: I traced the _height of “content_mc” and it was only slightly higher than the scrollpanes height, which is not what I expected because there are several textfields/button off the bottom of the scrollpane… what in the world is going on!!!

edit edit Edit: I found that i could work around this by adding a movieclip to “loader” in the library, setting it’s alpha to 0, and then scaling it taller using the _y position of the last attached button+its height and plus about 50 pixels because it still wasn’t scrolling all the way down. This works, but is a sloppy, pathetic, embarrassing, hack…SHAME… I must be missing something.

hi,

When working with scrollpane component and and with dyamic data with this components. try to use invalidate method of this component.

scrollpaneComponentInstanceName.invalidate();

Actually this is a uiObject class method and this method redraws the component.

with regards
sandeep(^_^)

thanks for the reply,

I tried that, but the scrollpane will only scroll down to a certain point, but not all the way to reveal the rest of the content. Do I need to do some sort of check to see if everything is loaded before i do the “invalidate” ? Im loading data from an XML object thats already loaded into the player…

hi

its always better to call this method when the data in the scrollpane is completely loaded.then before loading next content try to call “invalidate” method of flash.

with regards
sandeep(^_^)