开发者

Flash builder - spark list scroller : detect change on horizontalScrollPosition

开发者 https://www.devze.com 2023-03-14 13:44 出处:网络
I have a spark List component with a Horizontal layout applied to it. I would like to know if there\'s an event fired when the horizontalScrollPositi开发者_Python百科on changes.

I have a spark List component with a Horizontal layout applied to it. I would like to know if there's an event fired when the horizontalScrollPositi开发者_Python百科on changes.

I'm in a flash builder mobile project and I need this beacause I'm using the List as a slideshow viewer and the user can scroll the list with a sort of swipe gesture (or a mouse drag since the project will be also exported in AIR) and I want to avoid that two slide are partially displayed , straddling the viewport. The viewport is 1024px wide and each slide is 1024px and has to be perfectly centered on the viewport. I would like to catch the event mentioned above so I can detect the position of the content and set his position through a tween transition so I can achieve my goal.

Any ideas about this? I've tried googling around but with no luck, please help me!!!

Bye! Luke


Use DataBindings....

in component_CreationHandler:

{
   BindingUtils.bindSetter(value_changeHandler,scroller,"_horizontalScrollPosition");
}

public function value_changeHandler(scrollPos:Number):void{...}
0

精彩评论

暂无评论...
验证码 换一张
取 消