0 Replies Latest reply on Jan 23, 2008 6:47 PM by otnateos

    bug in Flex transition?

    otnateos Level 1
      Hi,

      I have problem while adding TabNavigator to the UI. Basically if I specify the TabNavigator and the children inside the main MXML, the Transition will be able to display it properly during state transition. However if I create another MXML component as a child of TabNavigator, and I add this new component into the UI, even though I set up specific order of transition, the transition doesn't work.

      here's my application.mxml
      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*">
      <mx:transitions>
      <mx:Transition fromState="*" toState="*" >
      <mx:Sequence>
      <mx:Resize duration="2000" target="{canvas1}" />
      <mx:AddChildAction target="{tbb2}" />
      <mx:AddChildAction target="{tbb}" />
      </mx:Sequence>
      </mx:Transition>
      </mx:transitions>
      <mx:states>
      <mx:State name="wstate">
      <mx:SetProperty target="{canvas1}" name="width" value="500"/>
      <mx:SetStyle target="{canvas1}" name="right"/>
      </mx:State>
      <mx:State name="rstate">
      <mx:SetStyle target="{canvas1}" name="right" value="200"/>
      <mx:AddChild position="lastChild">
      <mx:TabNavigator id="tbb" width="182" right="10" bottom="10" top="10">
      <mx:Canvas label="Tab 1" width="100%" height="100%">
      </mx:Canvas>
      <mx:Canvas label="anothertab" width="100%" height="100%">
      </mx:Canvas>
      </mx:TabNavigator>
      </mx:AddChild>
      </mx:State>
      <mx:State name="crstate">
      <mx:SetStyle target="{canvas1}" name="right" value="200"/>
      <mx:AddChild position="lastChild">
      <TabComp id="tbb2" width="182" right="10" bottom="10" top="10" />
      </mx:AddChild>
      </mx:State>
      </mx:states>
      <mx:Script>
      <![CDATA[
      function setwstate() { setCurrentState("wstate"); }
      function setrstate() { setCurrentState("rstate"); }
      function backtobase() { setCurrentState(""); }
      function tabnavcomp() { setCurrentState("crstate"); }
      ]]>
      </mx:Script>
      <mx:ApplicationControlBar x="144" y="0" dock="true" id="applicationcontrolbar1">
      <mx:Button label="Base state" click="backtobase()"/>
      <mx:Button label="State with setting width constraint" click="setwstate()"/>
      <mx:Button label="State with setting right constraint" click="setrstate()"/>
      <mx:Button label="state with tab nav comp" click="tabnavcomp()"/>
      </mx:ApplicationControlBar>
      <mx:Canvas top="10" left="10" right="10" bottom="10" backgroundColor="#FF0000" id="canvas1">
      </mx:Canvas>
      </mx:Application>



      here's my other component which the transition doesn't respect
      quote:


      <?xml version="1.0" encoding="utf-8"?>
      <mx:TabNavigator xmlns:mx=" http://www.adobe.com/2006/mxml" width="400" height="300">
      <mx:Canvas label="Tab Comp" width="100%" height="100%">
      </mx:Canvas>
      <mx:Canvas label="anothertab" width="100%" height="100%">
      </mx:Canvas>
      </mx:TabNavigator>




      Anyone know the work around for that?