zns72
06-25-2009, 05:37 PM
I have a movie clip that I am attaching the UIScrollbar to dynamically. I have thumbnails loading dynamically into a masked movieclip called thumbHolder_mc. The scrollbar moves up and down but does not move the content. Can anyone see what I am doing wrong? I thought targeting the movie clip with scroller.setScrollTarget(thumbHolder_mc); would work but it doesn't. I am at a loss.
My code:
//for the scroll barimport mx.utils.Delegate;
import mx.controls.UIScrollBar;
//scroll function
var scroller:UIScrollBar;
var nHeight:Number = 275;
var scrollBtnListener:Object = new Object();
scrollBtnListener.scroll = function(evt:Object) {thumbHolder_mc._y = -scroller.scrollPosition+211.4;
//y of thumbHolder};
//create scrollbar
scroller = createClassObject(UIScrollBar, "scroller", 1000, {_x:thumbHolder_mc._x+thumbHolder_mc._width-6, _y:thumbHolder_mc._y+15});
scroller.setScrollProperties(nHeight, 0, thumbHolder_mc._height-nHeight);
scroller.setSize(scroller.width, nHeight);
scroller.setScrollTarget(thumbHolder_mc);
//
My code:
//for the scroll barimport mx.utils.Delegate;
import mx.controls.UIScrollBar;
//scroll function
var scroller:UIScrollBar;
var nHeight:Number = 275;
var scrollBtnListener:Object = new Object();
scrollBtnListener.scroll = function(evt:Object) {thumbHolder_mc._y = -scroller.scrollPosition+211.4;
//y of thumbHolder};
//create scrollbar
scroller = createClassObject(UIScrollBar, "scroller", 1000, {_x:thumbHolder_mc._x+thumbHolder_mc._width-6, _y:thumbHolder_mc._y+15});
scroller.setScrollProperties(nHeight, 0, thumbHolder_mc._height-nHeight);
scroller.setSize(scroller.width, nHeight);
scroller.setScrollTarget(thumbHolder_mc);
//