Flex:根据事件动态添加效果

发布于 2024-11-02 05:33:43 字数 221 浏览 4 评论 0原文

是否可以向 Flex 组件添加基于事件的效果(showEffect、hideEffect、addedEffect...)?我们可以在 MXML 声明中注册它们

<s:TitleWindow showEffect="{myShowEffect}"/>

我可以在 AS 代码中做同样的事情吗(如样式的 setStyle() )?谢谢!

Is it possible to add event-based effects to Flex components (showEffect, hideEffect, addedEffect,...)? We can register them in MXML declaration

<s:TitleWindow showEffect="{myShowEffect}"/>

Can i do the same in AS code (like setStyle() for styles)? Thanks!

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

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

发布评论

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

评论(1

幻想少年梦 2024-11-09 05:33:43

在幕后,效果是作为样式实现的。因此,在 ActionScript 中设置效果的方式与设置样式的方式相同:

titleWindow.setStyle('showEffect',myShowEffect);

样式方法有时感觉像是所有未作为实际属性实现的内容的拼凑。

Under the hood, effects are implemented as styles. So, set an effect in ActionScript the same way you'd set a style:

titleWindow.setStyle('showEffect',myShowEffect);

The style approach sometimes feels like a kludge for everything not implemented as a real property.

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