我在这个简单的状态到状态转换上花了 2 个小时,只需调整大小和移动动画......我可以让元素移动和淡入淡出......但是根本没有调整大小的动画。面板元素始终保持相同的宽度。如果我将代码复制到一个全新的测试 mxml 文件中,它可以工作,但不在我的主应用程序文件中......我想知道这里是否有人可以帮助我。非常感谢。
//This is a custom component inside the main application...Not sure if it relates to my issue.....
<mx:Canvas 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="1000" height="600" xmlns:getcomplist="services.getcomplist.*" xmlns:components="components.*"
currentState="defaultState">
<fx:Script>
<![CDATA[
protected function compList_changeHandler(event:IndexChangeEvent):void
{
currentState="whenClick";
}
]]>
</fx:Script>
<mx:states>
<s:State name="defaultState"/>
<s:State name="whenClick" />
</mx:states>
<mx:transitions>
<s:Transition toState="whenClick">
<s:Parallel target="{animationIsAnnoying}">
<!--<s:Fade duration="1000"/>--> // Fade is working fine...
<s:Resize heightFrom="600" duration="5000" /> //resize is not working
<s:Move xFrom="500" duration="5000" /> //Move is working fine
</s:Parallel>
</s:Transition>
</mx:transitions>
<s:HGroup>
<s:List id="compList"
width="280"
height="500"
change="compList_changeHandler(event)">
</s:List>
<s:Panel id="animationIsAnnoying" height="150" includeIn="whenClick" /> //The panel I want to animated...
<components:compDisplayDetail includeIn="whenClick" id="compDisplay" width="600" height="500" userPic="{userPicResult.lastResult}" dataFromClick ="{compDetailinfoResult.lastResult}" />
</s:HGroup>
</mx:Canvas>