flash as crossfade help
- Started
- Last post
- 28 Responses
- stewart
i have two mc's on top of each other, both alpha set to 0.
now i want to fade in mc_1 to 100% in one second, wait 3 seconds and fade in mc_2 to 100% in one second on top of mc_1.
after that wait 3 seconds again, and fade mc_1 to 100% in 1 second on top of mc_2 etc etc.like a crossfade slideshow between 2 mc's, and the first mc fades in on a white background.
i've searched loads of tutorialwebsites, but they all come up with way too complex prototypescripts / xml blabla ect.
anyone with a deadsimple script/tutorial or explanation?
thanks!
- stewart0
D'oh!
- Engage_London0
when you fading in the second noe you are also in effect fading out the first one on top of a 100 percent second one... if that makes sense?
- Engage_London0
so each time, you're loading a new image under the old image... and then fading out the old image.
otherwise if you start fading the two... you'll get a weird transparency thing going on
- stewart0
good one...
i think so.but not sure if that is necessary for the best crossfade, because two fades at the same time, wouldn't that affect the performance too much when the images are bigger...
- Peter0
I'm going to get flamed for this...for not advocating actionscript. But basically you are flipping back and forth between two clips, yeah?
So you could probably just simply tween it and save some time off from scripting.This is baby stuff, I know, but how about 2 layers, one mc on each. Top layer mc alpha is 0, Bottom layer mc is at 100. Every third second just fade in the top clip, then fade it out. Then loop that.
And if you need the initial background white, just have some spare frames in the beginning without the bottom layer, and tell the movie to start the loop from whenever that first part has faded in.
Oh man am I getting flamed for this. Like before.
*fades out*
- unfittoprint0
//this example uses external images for a 'lighter' file
create an array 'images' with name/paths of the slideshow images.
create a number var named 'count'.
count values will change between 1 or 2.
create a number var named 'imgcount'.
imgcount values will refer to your images array index.
create the 2 holders, img1 & img2, and make their initial _alpha == 0;
make a refresh function to update the count / imgcount value and to start loading the image into the targetmc.
make a fade function + interval that takes an mc/alpha value as parameters
make a loadcheck loop interval to see if the target movie [img1 && img2] are finished loading the external img.
if finished, trigger the transition function[s]:
if(count == 1) ? fade(img1, 100) : fade(img1, 0);
if(count == 1) ? fade(img2, 0) : fade(img1, 100);
//the end
- skt0
Nice diagram stewart. Do a search for tween.as and use one if its functions to fade the clip.
- stewart0
okay, more complicated than i thought, but at least i have something that looks like a start right now.
http://pastebin.coconut.se/?id=4…
;)
- Engage_London0
but like i said... you are just fading image one on and off over the top of image two aren't you?
- stewart0
Engage...
that is possible, sure.
but i would like to have the option to (easily?) add a third mc fading in on top of mc_2
so i'm looking for something like i tried to explain in the diagram
- stewart0
so...
- Engage_London0
yuo want to add them below... and then fade out the previous... don't make life difficult for yourself
- stewart0
nonono!
mc_1 fade in
mc_2 fade in on top of mc_1
mc_1 disappears when mc_2 alpha=100%
mc_1 fade in on top of mc_2 etc etc
as in the graphic i posted...
- Engage_London0
isn't that the same as
blend up image 1
plonk image2 under image 1
fade out image 1
plonk image 3 under image 2
fade out image 2
plonk image n under image n-1
fade out image n-1
- stewart0
yes.
- two-zero0
just tween ONE to 0% thus revealing TWO which is at 100% then fade ONE back in to 100% and loop. what you are trying to accomplish doesn't take some crazy scripting. Not worth the time. then when a 3rd comes into play, just bump everything down. No need to make it complicated.
- skt0
You have mail.
- stewart0
hm, but i like what unfit wrote, but don't know 'exactly' how to fix that.
- stewart0
thanks skt,
i'll look at that file when i'm at home (mx only here).
i'm sure you can code that in 30 seconds. i hope you didn't use motiontweens though!