设置 x 属性 through effect 对 target UI 组件不起作用?
Setting the x property through effect does not work on target UI Component?
我有一个可以工作的移动效果,但现在我将它放入平行组合效果中,它不再有效。这是效果声明:
<s:Parallel id="slideToTheRightAnimation">
<s:Move id="slideToTheRightMove" target="{myComponent}" xFrom="0"
effectUpdate="trace('myComponent x=' + myComponent.x)"/>
</s:Parallel>
组件定义如下:
<comp:OptionsPalette id="myComponent" width="350" height="115" y="160"
layoutDirection="{LocaleManager.layoutDirection}"
visible="false"
requestPaletteClose="closeME()"
depth="-1">
<comp:filters>
<skins:StandardShadow/>
</comp:filters>
</comp:OptionsPalette>
我在调用 slideToTheRightAnimation play() 方法之前设置 xTo
属性。
我找到原因了。我已将组件的深度设置为 -1 以低于其他组件。设置时,x 属性 总是返回 NaN
。
将深度设置为 0 会导致移动效果再次起作用。不知道为什么会这样。我认为您可以将深度设置为负值,并且编译器不会抱怨并且组件会正确显示(尽管它没有移动或动画)。也许我在考虑 AS2 的深度问题???
我有一个可以工作的移动效果,但现在我将它放入平行组合效果中,它不再有效。这是效果声明:
<s:Parallel id="slideToTheRightAnimation">
<s:Move id="slideToTheRightMove" target="{myComponent}" xFrom="0"
effectUpdate="trace('myComponent x=' + myComponent.x)"/>
</s:Parallel>
组件定义如下:
<comp:OptionsPalette id="myComponent" width="350" height="115" y="160"
layoutDirection="{LocaleManager.layoutDirection}"
visible="false"
requestPaletteClose="closeME()"
depth="-1">
<comp:filters>
<skins:StandardShadow/>
</comp:filters>
</comp:OptionsPalette>
我在调用 slideToTheRightAnimation play() 方法之前设置 xTo
属性。
我找到原因了。我已将组件的深度设置为 -1 以低于其他组件。设置时,x 属性 总是返回 NaN
。
将深度设置为 0 会导致移动效果再次起作用。不知道为什么会这样。我认为您可以将深度设置为负值,并且编译器不会抱怨并且组件会正确显示(尽管它没有移动或动画)。也许我在考虑 AS2 的深度问题???