Adobe Flex:如何在启动延迟期间取消效果?
我已将发光效果 (glowIn) 应用于滚动时应用了 startDelay 的对象。我在推出时有另一种发光效果(glowOut)。如果用户在glowIn的startDelay期间鼠标脱离控制,我想取消该效果。我该怎么做?
在本例中,我使用 startDelay 为 300 毫秒的发光效果。我希望在项目实际显示效果之前有一个短暂的暂停,但如果用户在此期间将鼠标移出,我不希望播放效果。我将属性设置如下:
component.setStyle("rollOverEffect", glowIn);
component.setStyle("rollOutEffect", glowOut);
我认为这并不重要,但有问题的组件是在运行时创建的图表中的系列,因此如果可能的话,我更喜欢使用 actionscript 而不是 mxml 中的解决方案。
I've got a Glow effect (glowIn) being applied to an object on the roll over which has a startDelay applied. I have another glow effect (glowOut) on roll out. If the user mouses out of the control during the startDelay of glowIn, I want to cancel the effect. How do I do this?
In this instance, I'm using a glow effect with a startDelay of 300ms. I want a short pause before the item actually shows the effect, but I don't want the effect playing if the user mouses out during this time. I'm setting the properties as follows:
component.setStyle("rollOverEffect", glowIn);
component.setStyle("rollOutEffect", glowOut);
I don't think it matters much, but the component in question is a Series within a chart that gets created at runtime so I would prefer a solution in actionscript rather than mxml if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法找到解决此问题的完美解决方案,因此我最终所做的是在控件上为 MouseOver 和 MouseOut 设置鼠标事件处理程序,全局设置效果并在鼠标事件处理程序中检查effect.isPlaying() 。
然而,在播放开始延迟时中断效果会出现一些不一致的情况,并且会出现一些奇怪的结果。我设置了一个基本的调整大小效果,发现如果我在启动延迟期间将鼠标移开,该效果会正确取消。但是,如果我在效果开始时将鼠标移出,则控件会继续失控。
I was unable to find a perfect solution to this issue so what I ended up doing was setting up a mouse-event handler for MouseOver and MouseOut on the control, setting up the effects globally and checking effect.isPlaying() within the mouse event handler.
There are some inconsistencies, however, in interrupting the effect while the start delay is playing and there are some weird results. I set up a basic Resize effect and found that if I mouse out during the start delay, the effect is correctly cancelled. But if I mouseOut when the effect has started, the control continues to grow out of control.