0 Replies Latest reply on Mar 28, 2007 11:02 AM by ALyons

    Lookout, Newbie here. Transitions issue

    ALyons
      Can anyone tell me why the first transition works fine but the second doesn't???


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">

      <mx:Script>
      <![CDATA[
      import mx.effects.easing.*;
      import flash.text.Font;

      [Embed("assets/verdana.ttf", fontName="Myverdana")]
      public var verdana_font:Class;

      private function tracestate():void
      {
      trace(currentState);
      }
      ]]>
      </mx:Script>

      <mx:states>
      <mx:State name="Contact">
      <mx:SetProperty target="{panel1}" name="width" value="330"/>
      <mx:AddChild position="lastChild">
      <mx:Canvas x="369" y="27" width="367" height="262" cornerRadius="4" backgroundColor="#808080" borderStyle="solid" id="backpanel" filters="{[new DropShadowFilter(3, 45)]}" alpha="0.0" borderThickness="0">
      <mx:Canvas x="10" y="10" width="345" height="240" backgroundColor="#ffffff" filters="{[new DropShadowFilter(3, 45)]}" id="frontpanel">
      <mx:Label x="10" y="12" text="Name:" id="lblname" fontFamily="Myverdana" alpha="0.0"/>
      <mx:Label x="10" y="42" text="Email Address:" fontFamily="Myverdana" id="lblemail" alpha="0.0"/>
      <mx:Label x="10" y="69" text="Message:" fontFamily="Myverdana" id="lblmessage" alpha="0.0"/>
      <mx:TextInput x="60" y="10" width="255" id="frmname" alpha="0.0"/>
      <mx:TextInput x="106" y="38" width="209" id="frmemail" alpha="0.0"/>
      <mx:TextArea x="77" y="68" width="238" height="131" id="frmmessage" alpha="0.0"/>
      <mx:Button x="270" y="207" id="btnsend" click="currentState=''" fontFamily="Myverdana" width="65"/>
      <mx:Label x="286" y="209" text="Send" id="sendtext" fontFamily="Myverdana"/>
      <mx:LinkButton x="10" y="208" label="Go Back" id="lnkgoback" fontFamily="Myverdana" alpha="0.0" click="currentState='Home'"/>
      </mx:Canvas>
      </mx:Canvas>
      </mx:AddChild>
      </mx:State>
      <mx:State name="Home"/>
      </mx:states>

      <mx:transitions>

      <!-- transition from base to contact -->
      <mx:Transition id="first" fromState="*" toState="Contact">
      <mx:Sequence>
      <mx:Resize target="{panel1}" duration="500" />
      <mx:Fade alphaTo="1.0" duration="200" targets="{[sendtext,frontpanel,backpanel,lblname,lblemail,lblmessage,frmname,frmemail,frm message,btnsend]}" effectEnd="{tracestate()}" />
      </mx:Sequence>
      </mx:Transition>

      <!-- transition from Contact to base -->
      <mx:Transition id="second" fromState="Contact" toState="Home">
      <mx:Sequence>
      <mx:Fade alphaTo="0.0" duration="200" targets="{[sendtext,frontpanel,backpanel,lblname,lblemail,lblmessage,frmname,frmemail,frm message,btnsend]}" />
      <mx:Resize target="{panel1}" duration="500" effectEnd="{tracestate()}" />
      </mx:Sequence>
      </mx:Transition>
      </mx:transitions>

      <!-- Base Components -->
      <mx:Panel x="31" y="27" width="728" height="200" layout="absolute" title="Enemies Of ED" id="panel1">
      <mx:Text x="10" y="10" text="We Would Like To Hear From You! Click Below!" width="274"/>
      <mx:LinkButton x="10" y="36" label="Click Me !" themeColor="#ff0000" id="linkbutton1" click="currentState='Contact'"/>
      </mx:Panel>

      </mx:Application>