ScrollPane scroll bars not showing up after content changed

I'm just trying to create a class that controls a scrollpane to load a series of thumbnails off a website. The way I do it is everytime a thumbnail is added to the scrollpane, I create a new movie clip and position it under previous one. My problem is, after adding this new movieclip to content of scrollpane it doesnt' seem to recognize the size of the content has been changed and refuse to let you use the scrollbar. refreshPane() does not work, in fact when I tried refreshPane it showed me blank. I need someone tell me how I can fix this or show me an example of a scrollpane that loads MULTIPLE picture files into it's content then redraw the scrollbars correctly.

My stage area only has one ScrollPane component that has height of 590 and width of 130, the instance is named scrollThumb. The contentPath property of scrollThumb is pointed to a blank movieclip symbol named symScrollArea at design time.

I think you can only point ScrollPane to symbols and once you set the contentpath property to a symbol it creates a new instance of it. It might work if I add clips a movieClip then reset the contentpath property ... but that's for another day. Right now I want an answer to this asap :)

class Thumbnails {
      var scrollArea:MovieClip;
      var thumbsMC:Array = new Array();
      var thumbNotes:Array = new Array();
      var count:Number;
      function Thumbnails() {
            this.scrollArea = _root.scrollThumbs.content;
            this.count = 0;

      function addThumb(thumbURL:String) {
            this.count += 1;
            this.thumbNotes[this.count] = this.scrollArea.createEmptyMovieClip("mcThumb" + this.count.toString(), 4500 + this.count);
            with (this.thumbNotes[this.count])
                  _x = 0;
                  _y = (this.count - 1) * 120;
            _root.scrollThumbs.setSize(150, 590, false);
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.



after thumbnail resizing..
gotdoughAuthor Commented:
No luck with that. Can you manipulate a library symbol instance during run time? Or you have to have a moveclip on the stage.
I had some trouble with this a while back and found this solution after some digging around:

_root.scrollThumbs.setSize(_root.scrollThumbs.width, _root.scrollThumbs.height, false);

It seems to work very nicely, just be sure to have those as just .width and .height instead of ._width and ._height or it'll just set the scrollpane size.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

gotdoughAuthor Commented:
Hmm nothing seemed to happen when I do that, still no scroll bar. I know it would redraw scroll bars if I do setSize() after explicitly set the size of the content movieclip (that is stretch the entire movie clip by setting _height and _width).
Interesting, in the component property pane, what is the vScrollPolicy set to?  Doing that command once after I've added all my content to a scrollpane has worked quite nicely for me in the past.  Did you remove the setsize you have in there already?
gotdoughAuthor Commented:
vScrollPolicy is set to on, I changed it to auto and it didn't seem to affect anything. If you have a sample code that can add infinit graphic clips to a scrollpane, that would be as good as an answer. I'd like to see that and find the problem in my code.
nextX = 5;
nextY = 5;
offsetX = 50;
offsetY = 50;
firstX = nextX;

function buildItems():Void{
            for (var i = 0; i < myXML.childNodes[0].childNodes.length; i++){
                  tempMC = _root.scrollArea.content.attachmovie("attachMC", "attach"+i, 400+i, {_x:nextX, _y:nextY});
                  nextX += offsetX;
                  if(nextX > 750){
                        nextX = firstX;
                        nextY += offsetY;

I had to modify some code in order for it to make sense in this context, but it works for me.  Of course I'm not seeing why it shouldn't work for you in your code.  Hope that helps some.
gotdoughAuthor Commented:
Just spent an hour trying stuff. That's very close to what I want. Except that code is only able to attach library movieclips. I want to be able to use loadMovie for dynamic content. If your code used to load dynamic content (from file or URL) can you please give a little more hint?
What I've done is placed an empty clip inside the one loaded from the library, then you can do tempMC.loadMC.loadMovie("URL here");

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gotdoughAuthor Commented:
Okay I made a mistake. Attach movie is supposed to use the linkage name not the name of the instance.
gotdoughAuthor Commented:
Just to make it clear to anyone who read this thread and looking for solutions
1. You need to create a symbol and set the link identifier, the symbol cannot be empty
2. Use attachMovie to attach this symbol to the content property of your scrollpane
3. Call loadMovie or whatever on the returned handler to dynamicly change the content
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.