title: flex using tweenmax library
body: <p>I am currently using flex transition effects on state change. Is there a way I can use tweenmax library for that?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>In the code below, I have transitions from state one to state two. I would like to replace that code tweenermax library.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;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"&gt;
  &lt;s:states&gt;
      &lt;s:State name="NORMAL" /&gt;
      &lt;s:State name="CLICKED" /&gt;
  &lt;/s:states&gt;
  &lt;fx:Script&gt;
      &lt;![CDATA[
          import com.greensock.TweenMax;
  
          public function init():void
          {
              currentState = "CLICKED";
              TweenMax.to(topbar, 10, {x:0, startAt:{x:-500}});
          }
      ]]&gt;
  &lt;/fx:Script&gt;
  
  &lt;s:layout&gt;
      &lt;s:VerticalLayout paddingTop="5" paddingLeft="5" paddingRight="5"/&gt;
  &lt;/s:layout&gt;
  
  &lt;s:BorderContainer id="topbar" height="30" width="100%" includeIn="CLICKED" &gt;
      &lt;s:backgroundFill&gt; 
          &lt;s:SolidColor 
              color="#292929" 
              alpha="1"/&gt; 
      &lt;/s:backgroundFill&gt; 
  
  &lt;/s:BorderContainer&gt;
  
  &lt;s:HGroup id="hg"&gt;
      &lt;s:TextInput  /&gt;
  &lt;/s:HGroup&gt;
  &lt;s:Button click="init()" label="Click" /&gt;
  &lt;/s:Application&gt;
  </code></pre>