我相信我找到了正确的方法来做到这一点。有两个事件“addedEffect”和“removedEffect”当一个组件被添加为一个 VGroup 的子元素时被调用。
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="100%"
addedEffect="{addedEffect}"
removedEffect="{removedEffect}"
clipAndEnableScrolling="true" xmlns:gui="gui.*">
<fx:Declarations>
<s:Sequence id="addedEffect" targets="{[this, callWindow]}">
<s:Move duration="300" xTo="0" target="{callWindow}" />
</s:Sequence>
<s:Sequence id="removedEffect" targets="{[this, callWindow]}">
<s:Move duration="300" xFrom="0" xTo="300" target="{callWindow}" />
<s:Scale target="{this}"
scaleYFrom="1.0" scaleYTo="0.0"
duration="300"/>
</s:Sequence>
</fx:Declarations>
<gui:CallWindow id="callWindow"
width="100%" minHeight="0" x="300" />
</s:Group>
所以它是在项目级别完成的,但是有一种优雅的方法可以做到这一点。
谢谢,努诺