对可见事件的弯曲效果
我想创建一个在可见时应用调整大小效果的组件:
我这样做了:
<s:Panel id="loginPanel" title="Connect" creationCompleteEffect="customResize"
showEffect="customResize" hideEffect="fadeOut"
width="400" height="300" includeIn="login">
with:
<fx:Declarations>
<!-- Effects declaration -->
<s:Fade id="fadeIn" alphaFrom="0.0" alphaTo="1.0" duration="500"/>
<s:Fade id="fadeOut" alphaFrom="1.0" alphaTo="0.0" duration="500"/>
<s:Animate id="customResize" duration="1000">
<s:SimpleMotionPath property="percentWidth" valueFrom="0" valueTo="100"/>
<s:SimpleMotionPath property="percentHeight" valueFrom="0" valueTo="100"/>
</s:Animate>
</fx:Declarations>
问题是,当组件第一次显示时,效果可以正确播放,但是当状态发生变化时从“登录”到“工作”再回到“登录”,效果不再播放。
我认为会调度可见性事件并应用 showEffect,但状态更改似乎并不像我预期的那样工作。
如何在组件每次可见时应用效果?
I would like to create a component that apply a resize effect when the it is visible:
I did this:
<s:Panel id="loginPanel" title="Connect" creationCompleteEffect="customResize"
showEffect="customResize" hideEffect="fadeOut"
width="400" height="300" includeIn="login">
with:
<fx:Declarations>
<!-- Effects declaration -->
<s:Fade id="fadeIn" alphaFrom="0.0" alphaTo="1.0" duration="500"/>
<s:Fade id="fadeOut" alphaFrom="1.0" alphaTo="0.0" duration="500"/>
<s:Animate id="customResize" duration="1000">
<s:SimpleMotionPath property="percentWidth" valueFrom="0" valueTo="100"/>
<s:SimpleMotionPath property="percentHeight" valueFrom="0" valueTo="100"/>
</s:Animate>
</fx:Declarations>
The problem is that when the component is displayed for the first time, the effect is correctly played but when the state change for example from "login" to "working" then back to "login", the effect isn't played anymore.
I thought that a visibility event would have been dispatched and the showEffect applied but it seems that the state changes don't work like I was expecting.
How can I apply the effect each time the component is visible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定各州正在切换可见属性吗?
尝试强制更改 Visible 属性:
are you sure the states are toggling the visible property?
Try to force Visible property to change: