# If

**URL:** <https://forum.kirupa.com/t/if/224694>\
**Category:** Uncategorized\
**Created:** [May 4, 2007, 2:29pm UTC](https://forum.kirupa.com/t/if/224694 "2007-05-04T14:29:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andyryan](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@andyryan](https://forum.kirupa.com/u/andyryan)\
**Post date:** [May 4, 2007, 2:29pm UTC](https://forum.kirupa.com/t/if/224694/1 "2007-05-04T14:29:55Z")

</div>

right here it is…im tryin to produce a simple code that is applied TO A BUTTON that when is pressed does this:

increases the alpha of a box\_mc from 0-100 over say 30 frames;  
THEN loads an external jpeg into a container movie clip (placed below the box\_mc);  
THEN ONLY WHEN THE JPEG IS FULLY LOADED decreases the alpha of box\_mc from 100-0 over 30 frames.

All in all i am hoping to achieve a image fade out effect. Ideally i would like the effect to bleach(overexpose) the image into whiteout, which is an effect that i can achieve on the timeline, but ive been told i cannot modify the advanced colour settings using ACTIONSCRIPT 2.0 so this is my slightly less impressive solution. Any hints would be great.  
So far all ive got is:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;  
\_root.white\_block.\_alpha=0;  
button\_1.onRelease = function() {  
var button\_1\_tween:Tween = new Tween(\_root.white\_block, “\_alpha”, Strong.easeInOut, 0, 100, 20, false);

}

stop();
