Skip to main content
Inspiring
April 14, 2007
Question

Loadmovie Fade in and out

  • April 14, 2007
  • 3 replies
  • 1478 views
Ok, I am getting ready to start a new project and I want to make sure I'm on the right track! It will be a site that uses loadmovie (I hope) to fade pages in and out in equal amounts. (I.E movie 1 unloads and fades out at the same rate movie 2 loads up and fades in)I found a reply by Kglad for doing something similar with jpegs the code was:

on (rollOver) {
mc=this.placeholder_mc
mc._alpha=0;
loadMovie("Costume/Bailiff.jpg", "placeholder_mc");
clearInterval(fadeI);
fadeI=setInterval(fadeF,60,mc);
}

and attached to a frame:

function fadeF(mc){
if(mc.getBytesLoaded()>20&&mc.getBytesLoaded()>=mc.getBytesTotal()){
mc._alpha+=3;
if(mc._alpha>=100){
clearInterval(fadeI);
}
}
}

So I am hoping this will work with a swf. I think I would have to assign buttons which would unload current MC at a fade rate and have another MC fade in at that same rate. And I am guessing the buttons would be loaded on a layer above any of the movies. I am talking this out before I dive in just kind of helps. And I haven't had a great deal of experience yet with Flash and I also am going to read the help files now to see what I can dig up.
Is it possible?
This topic has been closed for replies.

3 replies

juresti
Known Participant
September 9, 2010

why does the sample code seem to be missing? Kglad's.

kglad
Community Expert
Community Expert
September 9, 2010

because these forum's have undergone several updates and 1 major change in the past few years.  many previous forum items haven't made it to the latest forum incarnation.

juresti
Known Participant
September 9, 2010

Thanks, kind of annoying! The sample code is left out!! O well thanks for the answer once again!

Sent from my iPhone

kglad
Community Expert
Community Expert
June 24, 2007
you don't have to, but it would be easier because you could code all the buttons in a short for-loop.
kglad
Community Expert
Community Expert
April 15, 2007
you'll need to use, at least, two place holder or target movieclips so when loading is complete you can fade out the previously loaded swf using one target while you fade in the current using the other target.
kglad
Community Expert
Community Expert
April 15, 2007
here's sample code:

Participant
June 24, 2007
Would you have to create an array for buttons if you wanted to replace your loadNextBtn with lets say 1Btn, 1Btn, 3Btn to corresponds to your "image" array? if so, how would you. I will try it out.

THanks