鼠标移动时激活循环
我只是要解释一下上下文,这样就更清楚了。
我制作了这个菜单:我的菜单
我希望制作一个改进和更高级的版本相同的菜单。
我在咖啡表面制作了一个波浪动画,并希望在鼠标移动时使其循环,在鼠标不移动时停止循环。
很抱歉缺乏规范,因为我对动作脚本很陌生,但我希望有人能够帮助我。 :)
谢谢, 马蒂厄
I'm just going to explain the context so it is clearer.
I made this menu : my menu
I am looking to make an improved and more advanced version of the same menu.
I made an animation of waves on the cofee's surface and am looking to make it loop when the mouse is moving and to stop looping when it's not.
Sorry for the lack of specifications as I am quite new to actionscript, but I hope somebody will be able to help me. :)
Thanks,
Mathieu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,你说过了 - 利用 MouseEvent.MOUSE_MOVE 在循环例程中设置条件。
Well, you said it - leverage MouseEvent.MOUSE_MOVE to set a conditional in your looping routine.
根据您希望它如何工作,我将按如下方式执行此操作:
一些示例代码如下:
当然,您需要执行诸如 call
init()
和 importflash.utils.Timer
之类的操作,并初始化 mouseMovementTimer 等变量、menuClip、coffeeClip 和 DELAY。警告:这段代码是我的想法,未经测试。因此,其中可能存在小错误,但您应该了解总体思路:
我认为这是解决您的问题的关键。我希望这能以某种方式帮助某人。
〜gmale
depending on how you want it to work I would do this as follows:
Some example code would be along the lines of:
Of course, you would need to do things like call
init()
and importflash.utils.Timer
and initialize variables like mouseMovementTimer, menuClip, coffeeClip and DELAY.Warning: This code is off the top of my head and untested. So there's likely to be small bugs in it but you should get the general idea:
I think that's the key piece to solving your problem. I hope that helps someone in some way.
~gmale