# \[Flash MX 2004\] Fade Function Call

**URL:** <https://forum.kirupa.com/t/flash-mx-2004-fade-function-call/128785>\
**Category:** Uncategorized\
**Created:** [November 16, 2004, 6:10am UTC](https://forum.kirupa.com/t/flash-mx-2004-fade-function-call/128785 "2004-11-16T06:10:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outro\_lugar](https://avatars.discourse-cdn.com/v4/letter/o/35a633/32.png) [@outro\_lugar](https://forum.kirupa.com/u/outro_lugar)\
**Post date:** [November 16, 2004, 6:10am UTC](https://forum.kirupa.com/t/flash-mx-2004-fade-function-call/128785/1 "2004-11-16T06:10:18Z")

</div>

**I have a function on root:**

\_root.fadeBox\_mc.onEnterFrame = function (){  
if (fade){  
this.nextFrame();  
} else {  
this.prevFrame();  
}  
};

\*\*  
and on root, a button with the code\*\*

on (rollOver){  
\_root.fade = true;  
}

on (rollOut){  
\_root.fade = false;  
}

**This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say**

on (press){  
\_root.fade = true;  
}

**the mc fades in, but I cant do another on (press) to fade out. Is this too confusing? Please help.**
