# TileList.scrollToIndex

**URL:** <https://forum.kirupa.com/t/tilelist-scrolltoindex/282829>\
**Category:** flash\
**Created:** [February 26, 2009, 9:18pm UTC](https://forum.kirupa.com/t/tilelist-scrolltoindex/282829 "2009-02-26T21:18:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rondog](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/rondog/32/2478_2.png) [@rondog](https://forum.kirupa.com/u/rondog)\
**Post date:** [February 26, 2009, 9:18pm UTC](https://forum.kirupa.com/t/tilelist-scrolltoindex/282829/1 "2009-02-26T21:18:31Z")

</div>

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:

```auto

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:

```auto

private function setPageNum():void
{
			
	pageText.text	=	currentPage + " / " + totalPages;
	tileList.scrollToIndex(currentPage);
			
}

```

any idea?
