Posts Tagged ‘scrollbar’
Posted: 7th May 2008
Tags: AIR, as3, Flex and Air, scrollbar
Posted in Flex and Air
Comments: 2 Comments »
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();
}
]]-->

![[image]](http://mowser.com/img?url=http%3A%2F%2Fclockobj.co.uk%2Fwp-content%2Fthemes%2Fcwo2%2Fimages%2Frss_large.png)
![[image]](http://mowser.com/img?url=http%3A%2F%2Fclockobj.co.uk%2Fwp-content%2Fthemes%2Fcwo2%2Fimages%2Fcwo-title.png)

![[image]](http://mowser.com/img?url=http%3A%2F%2Fclockobj.co.uk%2Fwp-content%2Fuploads%2F2008%2F09%2Ftwitter.png)



