# Dynamic fade in/out depending on what the user clicks

**URL:** <https://forum.kirupa.com/t/dynamic-fade-in-out-depending-on-what-the-user-clicks/171264>\
**Category:** flash\
**Created:** [December 3, 2005, 1:25pm UTC](https://forum.kirupa.com/t/dynamic-fade-in-out-depending-on-what-the-user-clicks/171264 "2005-12-03T13:25:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fourleafstudios](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fourleafstudios](https://forum.kirupa.com/u/fourleafstudios)\
**Post date:** [December 3, 2005, 1:25pm UTC](https://forum.kirupa.com/t/dynamic-fade-in-out-depending-on-what-the-user-clicks/171264/1 "2005-12-03T13:25:56Z")

</div>

Hey,

I am working on a background that changes depending on a button the user clicks. I using the zigo tweens over at laco.wz.cz/tween/ to fade one background into the other. At the moment i have two methods but both are flawed.

Method 1 example:  
[http://www.fourleafstudios.com/random/bgExample.swf](http://www.fourleafstudios.com/random/bgExample.swf)  
Method 2 example:  
[http://www.fourleafstudios.com/random/bgExample(depthswap).swf](http://www.fourleafstudios.com/random/bgExample.swf)  
Method 1 fla:  
[http://www.fourleafstudios.com/random/bgExample.fla](http://www.fourleafstudios.com/random/bgExample.fla)  
Method 2 fla:  
[http://www.fourleafstudios.com/random/bgExample(depthswap).fla](http://www.fourleafstudios.com/random/bgExample.swf)

Method 1: If you just click brown then red then green then go back up it works just fine, but if you choose a different route, say green then brown then red(quickly), it messes up.

Method 2: Doesn’t let you change when one background is being tweened into another.

Any ideas for getting the unmessablity of method 2 and combining it with the being able to change when one background is already being tweened part of method 1?
