2 Replies Latest reply on Feb 22, 2007 6:40 PM by jpwrunyan

    Effects & Transitions

    Whitetimer Level 1
      Hi All ...

      Ok i have a main mxml page which has 6 child views(components) in a viewstack and then each seperate view(component) has several child views.

      What i'd like to do is to use a dissolve effect on the hideEffect and showEffect on the main viewstack so that view1 fill dissolve out at the same time that view2 dissolves in. Any suggestions how i would do this ..

      hese are my main views;

      quote:



      <mx:Dissolve id="dissolveOut" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
      <mx:Dissolve id="dissolveIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>

      <mx:ViewStack id="vsMainBody" x="0" y="0" width="100%" height="100%">

      <views:vHome id="Home" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vAbout id="About" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vWhitetime id="Whitetime" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vNewearth id="Newearth" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vHealing id="Healing" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vInfo id="Information" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
      <views:vContact id="Contact" hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>

      </mx:ViewStack>



      Many thanks

      Shihan67
        • 1. Re: Effects &amp; Transitions
          jlingwai Level 1
          I think you might have to apply the effects to the overlaying container in the component???? I've had better luck using states and transistions, but that could just be me
          • 2. Re: Effects &amp; Transitions
            jpwrunyan Level 1
            I'm surprised the code as is doesn't do what you intend for it to. I had assumed that ViewStack hides the previous view at the same time as it shows the new view... therefore each view should have its effect play simultaneously. I can't test your code, but is that not happening? and if not, what is?
            One way you might get around this is to abandon ViewStack altogether and place your children in a Canvas, one on top of the other. Then use a TabBar to control the visible property of those children (you will need to implement a function to react to the TabBar's change event). Not exactly a desirable way to work but I should think it is guaranteed to do what you want.