# Scrollpane problem

**URL:** <https://forum.kirupa.com/t/scrollpane-problem/209074>\
**Category:** Uncategorized\
**Created:** [December 5, 2006, 6:47pm UTC](https://forum.kirupa.com/t/scrollpane-problem/209074 "2006-12-05T18:47:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robx2](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@robx2](https://forum.kirupa.com/u/robx2)\
**Post date:** [December 5, 2006, 6:47pm UTC](https://forum.kirupa.com/t/scrollpane-problem/209074/1 "2006-12-05T18:47:07Z")

</div>

Hey-

This problem is driving me crazy. I’m trying to add dynamic content into a scrollpane that’s embedded in a movieClip I’m pulling from the library and attaching to the stage in a number of instances.

Thought this would solve my problems:  
[http://kirupa.com/developer/flash8/scrollpane\_dynamic\_mc.htm](http://kirupa.com/developer/flash8/scrollpane_dynamic_mc.htm)

BUT:

I can’t seem to access the content area of the scrollpane at all… I can trace the scrollpane itself, but when I try to attach stuff to spContentHolder or assign a variable to scrollpane.content i get nothing…

Here’s the code… Many thanks in advance…

function loadInfo() {  
for (var j = 0; j\<allCoaches.length; j++) {  
//attaching new instances of the movie clip  
var newCoachBar:MovieClip = \_root.attachMovie(“coachBar\_mc”, “coachBar\_mc”+j, j);

```
    //set up scroll bar 
    //using var mcMain to access content area
    var mcMain:MovieClip;
        //empty movie clip in library with linkage name "scrollClip_mc"
        newCoachBar.infoBox_mc.scrollPane.contentPath = "scrollClip_mc";
        mcMain = newCoachBar.infoBox_mc.scrollPane.content;
        trace(mcMain);//always traces undefined
    
    //this is the loop where i'm attaching dynamic content
    for (var m = 0; m&lt;allCoaches[j].reasons.length; m++) {
        var newProgress_mc: = mcMain.attachMovie("progress_mc", "progress_mc"+m, mcMain.getNextHighestLevel());
        //using newCoachBar.infoBox_mc.scrollPane.spContentHolder instead of mcMain doesn't work either
        newProgress_mc._x = 0;
        newProgress_mc._y = 0+(m*25);
        newProgress_mc.progReason_txt.text = allCoaches[j].reasons[m].reasonText;
        newProgress_mc.progAmount_txt.text = allCoaches[j].reasons[m].reasonAmount;
        //newCoachBar.infoBox_mc.scrollPane.invalidate();
    }

```

//calling another function on finish  
initCoaches(newCoachBar, coachFieldPct);  
}

}
