Is it possible to tween scroll position of ScrollPane component with TweenLite?
In actionscript3, using the ScrollPane component and the TweenLite package, would it be possible to animate to a particular scrol开发者_运维百科l position? This seems like it should be possible, but I'm not sure exactly how to go about it. Thanks!
I figured it out, so I thought I should go ahead and post the solution. It is indeed possible to use TweenLite to animate to a scroll position on a ScrollPane component.
You just need to do:
TweenLite.to(yourScrollPane, 1, {verticalScrollPosition: yourScrollPane.verticalScrollPosition+amountToScroll});
Tweenlite also provides a scrollRect Plugin.
You have to scoll down to the plugin Examples and there you have to scroll again.
Their example:
import com.greensock.*;
import com.greensock.easing.*;
TweenLite.to(mc, 1, {scrollRect:{left:0, right:288, top:0, bottom:216}});
Be careful with the parentheses after the scrollRect
attribute. The first time I overlooked it.
精彩评论