是否可以使用 TweenLite 调整 ScrollPane 组件的滚动位置?

发布于 2024-09-18 06:32:05 字数 89 浏览 11 评论 0原文

在actionscript3中,使用ScrollPane组件和TweenLite包,是否可以动画到特定的滚动位置?这似乎应该是可能的,但我不确定具体如何去做。谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如果没结果 2024-09-25 06:32:06

Tweenlite 还提供了一个scrollRect插件。

您必须向下滚动到插件示例,然后再次滚动。

他们的示例:

import com.greensock.*; 
import com.greensock.easing.*;

TweenLite.to(mc, 1, {scrollRect:{left:0, right:288, top:0, bottom:216}});

请注意 scrollRect 属性后面的括号。我第一次忽略它。

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.

我想通了,所以我想我应该继续发布解决方案。确实可以使用 TweenLite 将动画设置到 ScrollPane 组件上的滚动位置。

你只需要做:

TweenLite.to(yourScrollPane, 1, {verticalScrollPosition: yourScrollPane.verticalScrollPosition+amountToScroll});

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});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文