Hello,
I am using the Scroller with direction set to "horizontal".
I need the scroller to display the thumbnails aligned to the left for one content and aligned to the right when another content has been selected.
How can I influence the alignment of the thumbnails to left or right?
As my swf is displayed with 100% I use
myScroller.setSize(stage.stageWidth-40,60);
(The scroller's width is stage width - 40 with x=20, so it is centered with a 20 pixel horizontal distance.)
For some reason it is quite unpredictable how the thumbnails layout will react. Can you help?
Here is the entire code:
function initThumbnailScroller():void {
myScroller = new ThumbnailScroller();
myScroller.itemHeight=60;
//myScroller.itemWidth=60;
myScroller.mouseScroll=false;
myScroller.mouseScrollSpeed=3;
myScroller.preloaderFillAlpha=0.25;
myScroller.preloaderFillColor=0xA9AAAC;
myScroller.preloaderLineAlpha=0;
myScroller.preloaderLineColor=0xffffff;
myScroller.preloaderSize=8;
myScroller.preloaderType="pie";
myScroller.reflection=false;
myScroller.scaleMode="maintainAspectRatio";
myScroller.scrollAmount=200;
myScroller.scrollDuration=1;
myScroller.scrollEasing="quadraticInOut";
myScroller.selectOver=1;
myScroller.space=10;
myScroller.temporaryClipAlpha=0;
myScroller.temporaryClipColor=0xCCCCCC;
myScroller.useCacheAsBitmap=true;
myScroller.verticalAlign="top";
myScroller.direction="horizontal";
myScroller.effect=scrollerEffect;
myScroller.setSize(sW-40,60);
if (tempTopic=="content_1") {
myScroller.move(20,scrollerY);
myScroller.selectedAlign="right";
} else {
myScroller.move(20,scrollerY);
myScroller.selectedAlign="left";
}
stage.addEventListener(KeyboardEvent.KEY_UP, keyPressed);
myScroller.addEventListener(ScrollerEvent.ITEM_CLICK, itemClickHandler);
myScroller.addEventListener(ScrollerEvent.ITEM_SELECTED, eventHandler);
myScroller.addEventListener(ScrollerEvent.ITEM_COMPLETE, itemCompleteHandler);
myScroller.addEventListener(ScrollerEvent.ITEM_COMPLETE, firstItemLoaded);
myScroller.addEventListener(ScrollerEvent.ITEMS_LOAD_COMPLETE, AllItemsLoaded);
addChild(myScroller);
}
