4 Replies Latest reply on Jul 16, 2007 2:18 AM by JabbyPandaUA

    Resize During Transition - Flex Bug?

    jfillman Level 1
      I'm using move and resize parrallel transitions. Everything works fine if the user doesn't change the size of the window while the transition is occuring. If the screen gets resized, it does not go all the way to the correct position and then jumps to the correct position at the end of the transation. If, however, I set a specific height and width in the application tag, this does not occur. I really don't want to specify a height and width for the application. My assumption is that once the transition starts, it determines a fixed end point that doesn't change when re-sized.

      I've tried in Flex 2.0.1 and the current Flex 3 M2 Beta 1 release with identical results.
        • 1. Re: Resize During Transition - Flex Bug?
          JabbyPandaUA Level 3
          Please, share some sample code with us :)
          • 2. Re: Resize During Transition - Flex Bug?
            jfillman Level 1
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp();" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#010101, #000000]">
            <mx:State name="Intro">
            <mx:SetStyle target="{globe}" name="left"/>
            <mx:SetStyle target="{globe}" name="horizontalCenter" value="0"/>
            <mx:SetStyle target="{globe}" name="top"/>
            <mx:SetStyle target="{globe}" name="verticalCenter" value="0"/>
            <mx:SetProperty target="{globe}" name="width" value="350"/>
            <mx:SetProperty target="{globe}" name="height" value="350"/>
            <mx:Transition id="myTransition" fromState="*" toState="*">
            <mx:Parallel id="t1" targets="{[globe]}">
            <mx:Move duration="6000"/>
            <mx:Resize duration="6000"/>
            import flash.events.TimerEvent;
            import flash.utils.Timer;

            var timer1:Timer = new Timer(1, 1);

            private function initApp():void{
            timer1.addEventListener(TimerEvent.TIMER, onTimer1);
            \ }

            private function onTimer1(evt:TimerEvent):void {

            \ ]]>

            <mx:Image source="images/background2.JPG" id="background" width="1280" x="0" height="800" y="0"/>
            <mx:Image width="100" height="100" source="images/globe.gif" id="globe" top="31" left="32"/>
            • 3. Re: Resize During Transition - Flex Bug?
              jfillman Level 1
              If you add height and width to the application tag:

              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp();" height="800" width="1280" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#010101, #000000]">

              You can resize it all you want during the transition, with no issues.
              • 4. Resize During Transition - Flex Bug?
                JabbyPandaUA Level 3
                Thanks, for the code.

                I think It is impossible to use correctly build-in Flex <mx:Move> and <mx:Resize> effects with containers that can change the size during the transformation operation.

                If you really need to support this type of the behavior, I would advice to code "move" and "resize" operations by youself (by changing X,Y, scaleX, scaleY coordinates inside some onEnterFrame event handler) and adjuct current object's X, Y coordinates with some tween motion effect inside "resize" event handler.