PDA

View Full Version : [FMX]_alpha crossfade between 2 MC's Help



dcell
April 22nd, 2003, 09:57 AM
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

Flashmatazz
April 22nd, 2003, 10:20 AM
speed = 10;
bigCalendar_mc.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += speed;
myOtherMC._alpha = (100 - this._alpha);
}
else {
delete this.onEnterFrame;
}
};

SteveD
April 22nd, 2003, 10:21 AM
Hi,
Just insert this line of code :
instancename._alpha -=speed;

after this :this._alpha += speed;

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)

dcell
April 22nd, 2003, 10:56 AM
Many thanks!!!
I was going a little nutz...ok...a lot nutz.

Much appreciate your help!!
Dcell(-:

Flashmatazz
April 22nd, 2003, 05:02 PM
Np problem :)