0 Replies Latest reply on Aug 22, 2007 3:23 PM by jkahn117

    Dynamically set transition target

      We are building an application that has multiple steps. As each step is completed, I would like it to move off to the left of the screen with the new screen moving in from the right edge. I am using multiple states and have created a transition that I would like to set the targets as the state is changing. The problem is that the old screen simply disappears, it does not slide away (the new screen does slide in from the right). Any thoughts?

      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" height="490" width="860"
      currentState="{ model.stateManager.current }"

      import mx.states.State;
      import mx.events.StateChangeEvent;

      [Bindable] private var model : WMModelLocator = WMModelLocator.getInstance();

      private function prepareForStateChange(event : StateChangeEvent) : void
      if (event.oldState != "")
      this.leftSlide.fromState = event.oldState;
      this.leftSlide.toState = event.newState;

      this.leftSlideOldStateEffect.target = persona;
      this.leftSlideNewStateEffect.target = plan;


      <mx:State name="{ StateManager.STATE_PERSONA }">
      <mx:AddChild position="lastChild">
      <persona:SelectPersona id="persona" />
      <mx:State name="{ StateManager.STATE_PLAN }">
      <mx:AddChild position="lastChild">
      <accum:RetirementPlanning id="plan" />

      <mx:Transition id="leftSlide">
      <mx:Sequence id="leftSlideOldStateEffect">
      <mx:Move xFrom="0" xTo="-1000" duration="2000" />
      <mx:RemoveChildAction />
      <mx:Move id="leftSlideNewStateEffect" xFrom="1000" xTo="0" duration="2000" />