# \[FMX\]\_alpha crossfade between 2 MC's Help

**URL:** <https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904>\
**Category:** flash\
**Created:** [April 22, 2003, 1:57pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904 "2003-04-22T13:57:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcell](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@dcell](https://forum.kirupa.com/u/dcell)\
**Post date:** [April 22, 2003, 1:57pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904/1 "2003-04-22T13:57:31Z")

</div>

I have 2 movieClips that I want to fade.  
mc 1 fades out while mc2 fades in. I want to do it in AS to keep my file size down, 'cause I will be having quite a few of this happing.

I know how to have one mc fade in using:  
(I know this is a fade in and I can fadein/out individually)

speed = 10;  
bigCalendar\_mc.onEnterFrame = function() {  
if (this.\_alpha\<100) {  
this.\_alpha += speed;  
} else {  
delete this.onEnterFrame;  
}  
};

But my brain is hurting trying to figure out how to get the two crossfading.

Many thanks!!  
Dcell

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 2:20pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904/2 "2003-04-22T14:20:16Z")

</div>

```auto

speed = 10;
bigCalendar_mc.onEnterFrame = function() {
  if (this._alpha<100) {
    this._alpha += speed;
    myOtherMC._alpha = (100 - this._alpha);
  } 
  else {
    delete this.onEnterFrame;
  }
};

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 2:21pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904/3 "2003-04-22T14:21:44Z")

</div>

Hi,  
Just insert this line of code :  
[AS]instancename.\_alpha -=speed;[/AS]

after this :[AS]this.\_alpha += speed;[/AS]

That should do the trick

Cheers

SteveD

quick edit, just seen razz’s post, that code is far more effective - now why didn’t I think of that (lol)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 2:56pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904/4 "2003-04-22T14:56:17Z")

</div>

Many thanks!!!  
I was going a little nutz…ok…a lot nutz.

Much appreciate your help!!  
Dcell(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 22, 2003, 9:02pm UTC](https://forum.kirupa.com/t/fmx--alpha-crossfade-between-2-mcs-help/18904/5 "2003-04-22T21:02:27Z")

</div>

Np problem 🙂
