2 Replies Latest reply on Jun 27, 2011 4:12 AM by raffialexanian

    Title Window animation

    raffialexanian

      Dear all coders, this thing has been driving me nuts for many many hours now, so any help is appreciatted.

       

      Am trying to animate a popup titlewindow when it appears, I have a code that works when the titlewindow code is inside the main application, but when it is a seperate component, I cant get it to work, and I almost tried everything, well am sure not everything cause I still didn't figure out the answer:

       

      Code that works:

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application name="Spark_Panel_showEffect_test"

         xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/halo">

      <s:layout>

      <s:VerticalLayout />

      </s:layout>

      <fx:Declarations>

      <s:Parallel id="showEff">

      <s:Rotate3D angleYFrom="-90" angleYTo="0" />

      <s:Fade alphaFrom="0.0" alphaTo="1.0" />

      </s:Parallel>

       

      <s:Parallel id="hideEff">

      <s:Rotate3D angleYFrom="0" angleYTo="-90" />

      <s:Fade alphaFrom="1.0" alphaTo="0.0" />

      </s:Parallel>

      </fx:Declarations>

       

      <fx:Script>

      <![CDATA[

      private function visibilityPanel():void

      {

      panel.visible = true;

      }

      ]]>

      </fx:Script>

      <s:Button id="btn"

        label="Visibility"

        click="visibilityPanel();" />

       

      <s:Panel id="panel" visible="false"

      title="Panel title"

      showEffect="{showEff}"

      hideEffect="{hideEff}">

      </s:Panel>

      </s:Application>

       

       

       

       

      Code of main app that does not work:

       

       

      <?xml version="1.0" encoding="utf-8"?>

       

      <s:Application name="Spark_Panel_showEffect_test"

         xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/halo">

      <s:layout>

      <s:VerticalLayout />

      </s:layout>

       

      <fx:Declarations>

       

      </fx:Declarations>

       

      <fx:Script>

      <![CDATA[

      import mx.managers.PopUpManager;

      private function visibilityPanel():void

      {

      var pop = new panelTest ;

      PopUpManager.addPopUp(pop, this, false);

      }

      ]]>

      </fx:Script>

      <s:Button id="btn"

        label="Visibility"

        click="visibilityPanel();" />

       

      </s:Application>

       

       

      TitleWindow Component:

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"

         xmlns:s="library://ns.adobe.com/flex/spark"

         xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"

         showEffect="{showEff}"

         hideEffect="{hideEff}"

         >

      <fx:Declarations>

      <s:Parallel id="showEff">

      <s:Rotate3D angleYFrom="-90" angleYTo="0" />

      <s:Fade alphaFrom="0.0" alphaTo="1.0" />

      </s:Parallel>

       

      <s:Parallel id="hideEff">

      <s:Rotate3D angleYFrom="0" angleYTo="-90" />

      <s:Fade alphaFrom="1.0" alphaTo="0.0" />

      </s:Parallel>

      </fx:Declarations>

      </s:TitleWindow>

      Please please help on this; the title pops up, but does not animate,
      Thanks