You can also use the Sequence class.
http://blog.flexexamples.com/2008/04/23/sequencing-effects-in-flex-using-the-mxsequence-tag-redux/

Has a great example of this.

On Fri, Jan 9, 2009 at 10:02 AM, Ward Loockx <[email protected]> wrote:

>   Just use the effectend event.. small quick and dirty example included ;)
>
> Greets,
> Ward Loockx
>
> <mx:script>
>
> private var fadeBIn:fade;
> private var fadeBOut:fade;
> private var fadeAIn:fade;
> private var fadeAOut:fade;
>
> private function creationcomplete():void
> {
> fadeAOut.alphaTo = 0;
> fadeAOut.alphafrom = 1;
> fadeAOut.target= comp1;
> fadeAOut.addEventListener(Effect.effectEnd,fadeToControlA);
>
> fadeBOut.alphaTo = 0;
> fadeBOut.alphafrom = 1;
> fadeBOut.target= comp2;
> fadeBOut.addEventListener(Effect.effectEnd,fadeToControlB);
>
> fadeBIn.alphaTo = 1;
> fadeBIn.alphafrom = 0;
> fadeBIn.target= comp2;
>
> fadeAIn.alphaTo = 1;
> fadeAIn.alphafrom = 0;
> fadeAIn.target= comp1;
>
> }
>
> private function fadeToControlA():void
> {
> fadeBIn.play();
> }
>
> private function fadeToControlB():void
> {
> fadeAIn.play();
> }
>
> </mx:script>
>
> <mx:component1 id="comp1" />
> <mx:component1 id="comp2" />
>
> <mx:Button label="A" click="{fadeAOut.play()}" />
> <mx:Button label="B" click="{fadeBOut.play()}" />
>
> simonjpalmer schreef:
>
> >
> > I have two custom controls which I want to fade in and out in response
> > to a button click, so, control A is showing, press the B button, A
> > fades out and control B fades in. I know how to set show and hide
> > effects but they seems to happen simultaneously, which is really ugly.
> > How do I make B's fade in start as A's fade out finishes?
> >
> > I'm using FLex 2, although I doubt that matters much.
> >
> >
>
>  
>



-- 

Cheers,
Nate
----------------------------------------
http://blog.natebeck.net

Reply via email to