我目前正在使用状态变化的flex过渡效果。有没有办法可以使用tweenmax库?
更新
在下面的代码中,我从状态1转换到状态2。我想替换代码tweenermax库。
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
currentState="NORMAL">
<s:states>
<s:State name="NORMAL" />
<s:State name="CLICKED" />
</s:states>
<fx:Script>
<![CDATA[
import com.greensock.TweenMax;
public function init():void
{
currentState = "CLICKED";
TweenMax.to(topbar, 10, {x:0, startAt:{x:-500}});
}
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout paddingTop="5" paddingLeft="5" paddingRight="5"/>
</s:layout>
<s:BorderContainer id="topbar" height="30" width="100%" includeIn="CLICKED" >
<s:backgroundFill>
<s:SolidColor
color="#292929"
alpha="1"/>
</s:backgroundFill>
</s:BorderContainer>
<s:HGroup id="hg">
<s:TextInput />
</s:HGroup>
<s:Button click="init()" label="Click" />
</s:Application>