Monday, March 16, 2009

Flash CS3 UI Scrollbar

Guys, if you attach the UI Scrollbar component with Dynamic textbox in Flash where the text will be populated from XML or a Text file, the scrollbar won't work and resize automatically.

When I was working on one of my flash component where the data was being populated from XML, I assumed that the scrollbar will automatically adjust according to the amount of the data but nothing really happened.

So to make the scrollbar work after you have populated your dynamic textbox with the content you can type the following action to make the UIScrollbar work -

mc_scroll.maxScrollPosition = details.textHeight;

"mc_scroll" is the instance name of my scrollbar attached with the dynamic textbox & "details" is the name of my dynamic text box.


Anonymous said...

Great little tip, thanks!

Oliver Brelsford said...

Dude, you are awesome. That one line was exactly what I needed to go from non-functional to WORKING PERFECTLY!


la said...

thanks! exactly what i wanted to know!