Posts Tagged ‘scrollbar’

May
7
Changing Flex3 ScrollBar maxScrollPosition at runtime


Posted: 7th May 2008
Tags: , , ,
Posted in AIR, Flex, as3
Comments: 1 Comment »

A quick tip if you have a dynamic scroll bar and want to bind it’s maxScrollPosition to a value at runtime unfortunately you can’t use the MXML binding, i.e. maxScrollPosition={value}.

Alternatively you need to set the value programatically in an event handler, AND importantly call updateDisplayList() on the scrollbar. i.e.

 
		<!--[CDATA[
			private function handleSlideChange():void {
				scroll.maxScrollPosition = slider.value;
				scroll.invalidateDisplayList();
			}
		]]-->