0
votes

In actionscript3, using the ScrollPane component and the TweenLite package, would it be possible to animate to a particular scroll position? This seems like it should be possible, but I'm not sure exactly how to go about it. Thanks!

2

2 Answers

2
votes

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});
1
votes

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.