There's probably a better (or more correct) way to do this, but here's how I got scrolling segments in the v2 Accordion component:
Actionscript:
-
function buildSegments(){
-
for (var i=0; i<7; i++){
-
var pane = my_acc.createSegment("ScrollPane", "s"+i, "Segment "+i);
-
pane.contentPath = "mcLinkageID"; //the content to scroll
-
}
-
-
resizeScrollers();
-
}
-
-
function resizeScrollers(){
-
for (var i=0; i<7; i++){
-
var pane = my_acc.getChildAt(i);
-
pane.setSize(pane._parent.width, my_acc.calcContentHeight())
-
-
}
-
}
i had to break it up into two separate loops, since the results from my_acc.calcContentHeight() would return a different value after each new segment was added.
Pls share your source