AS3 中的惯性拖动(傻瓜版)

发布于 2024-09-07 08:51:16 字数 214 浏览 2 评论 0原文

我正在尝试创建一个限制于 x 轴的拖动惯性效果。我知道这个问题之前在这里被问过,但我无法理解答案!

我目前正在使用 startDrag 和 stopDrag。我假设我应该在 startDrag 函数中添加一些内容来捕获用户移动鼠标的速度,但我不确定这是如何完成的。我想然后我会在 stopDrag 函数中添加一些东西,该函数会启动并使对象继续以该速度移动,然后停止。

有什么建议吗?

I'm trying to create an inertia effect for dragging that's constricted to the x axis. I know this questions was asked before here but I couldn't understand the answer!

I'm currently using startDrag and stopDrag. I'm assuming I should add something to the startDrag function that captures the speed in which the user is moving the mouse, but I'm not sure how this is done. I guess then I'd add something to the stopDrag function that kicks in and makes the object keep moving at that speed and then come to a stop.

Any suggestions?

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

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

发布评论

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

评论(1

风轻花落早 2024-09-14 08:51:16

我找到了一个很好的在线教程,里面有答案。我只是在修改代码。作者甚至还提供 .fla 文件可供下载。

http://www.quasiuseful.com/?id=11

I've found an grat online tutorial that has the answer. I was a matter of tinkering with the code. The writer even has .fla files for download.

http://www.quasiuseful.com/?id=11

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