PDA

View Full Version : canvas scrollbar appears, doesn't scroll content


bmilesp
11-11-2008, 03:21 PM
I have a class that extends canvas and i populate it like so:


for each (var group:XML in dataProvider.group) {
card[i] = new CardComponent();
card[i].x = this.x + (offset_x * i);
card[i].y = this.y + (offset_y * i);
card[i].z = z_depth;
this.addChild(card[i]);
i++;
}

the scrollbar will appear when the number of cards exceeds the boundaries, but the scrollbar doesn't scroll the content when dragged back and forth. Although the scrollbar does size correctly proportionate to the content. Is there additional code i need to add for the scroll functionality to work? Thank you in advance -b

bmilesp
11-12-2008, 02:47 PM
I wanted to add, that when i use a mouseEvent.CLICK handler that does this:


this.horizontalScrollPosition += 100;

the scrollbar does move, but the content in the canvas still doesn't? Do I need to set up a scrollRect and apply that? It seems rather redundant to do it this way. Any guidance is appreciated.