I cant get the scrollToIndex function to work. I have two arrows going left and right for my next and previous buttons.
My tilelist is vertical and only shows one item at a time. I am not getting an errors or anything, it just doesnt scroll. Here is how I initiate my tile list:
private function initSpec(e:Event):void
{
this.removeEventListener(Event.ADDED_TO_STAGE, initSpec);
holder = (this.parent as MovieClip).specSheetHolder;
tileList = new TileList();
for (var i:int = 1; i <= pages; i++)
{
tileList.addItem({source:["pages/page" + i + ".swf"]});
}
tileList.columnWidth = 850;
tileList.rowHeight = 1200;
tileList.columnCount = 1;
tileList.rowCount = 1;
tileList.height = stage.stageHeight;
tileList.width = stage.stageWidth;
tileList.scrollPolicy = ScrollPolicy.ON;
tileList.direction = ScrollBarDirection.VERTICAL;
holder.addChild(tileList);
}
and then this calls the scrollToIndex:
private function setPageNum():void
{
pageText.text = currentPage + " / " + totalPages;
tileList.scrollToIndex(currentPage);
}
any idea?