1 Reply Latest reply on Jul 8, 2011 2:25 PM by Shongrunden

    Problem with spark:resize effect and constraint-layout

    Kalle Werning



      maybe its just a missuderstanding, but how i an get this to work.


      Also move effects doesnt seem to work.


      Does somebody have a Link, where I can get deeeper in constraints and spark.effects?


      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      minWidth="955" minHeight="600"
                      width="100%" height="100%"


                   import flash.utils.Timer;
                   import flash.events.TimerEvent;
                   import flash.events.Event;


                  private var timer:Timer;
                   private function init():void {
                       timer = new Timer(5000);
                       timer.addEventListener(TimerEvent.TIMER, switcher);


                   public function switcher(event:TimerEvent):void {
                       if (currentState =="State1") {
                           currentState = "State2";
                       } else  {
                           currentState = "State1";
               <s:State name="State1"/>
               <s:State name="State2"/>
               <s:Transition fromState="State1" toState="State2">
                   <s:Resize target="{mainPanel}" />
               <s:Transition fromState="State2" toState="State1">
                   <s:Resize target="{mainPanel}" />


          <s:Panel id="mainPanel"
                   horizontalCenter="0" verticalCenter="0"
                    width.State1="250"  height.State1="200"
                    horizontalCenter.State2="0" verticalCenter.State2="0"
                    left.State2="20" right.State2="20" top.State2="10" bottom.State2="50">

        • 1. Re: Problem with spark:resize effect and constraint-layout
          Shongrunden Adobe Employee

          I think there are bugs in this area for transitioning an objects size between states where two different sizing mechanisms are in play.


          If you transition from constraints to constraints or from width/height to width/height it should work better:


              <s:Panel id="mainPanel"

                       horizontalCenter="0" verticalCenter="0"

                       left.State1="200" right.State1="200" top.State1="100" bottom.State1="500"

                       left.State2="20" right.State2="20" top.State2="10" bottom.State2="50">