Skip to main content
June 4, 2009
Question

fade out effect before loading external movie clip?

  • June 4, 2009
  • 1 reply
  • 1011 views

Hello!  I'm building a flash web site that has 6 pages.  Whenever someone clicks on a nav button, the corresponding .swf file loads into a blank movie clip I have on my home page. What I'd like to do is have the content on the current page fade out before the content on the new page fades in. I've used Flash for years, but this is the first web site I've built entirely in Flash, and I don't quite know how to approach this....   I'm assuming ActionScript would be the easiest and most efficient way to produce this effect, but I don't know how to go about doing it.  Is there a way to tell the current movie to go to a certain frame in the movie and play it before loading the next external movie clip?  

Any suggestions would be much appreciated.  

Thank you,

Nicole

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
June 4, 2009

use two target movieclips.  one for the currently displaying swf and one for the next one that you'll want to display.  when a button is clicked start the loading of the next swf  and use preloader code or the onLoadInit() method of the moviecliploader class listener to start the fade out of the current target movieclip (using a tween class or actionscript) and start the fade-in of the just loaded target.  when fading is complete assign the current target to the just loaded target.

June 4, 2009

I'm sorry but that just went way over my head.   Here's an example of the script I have on a button... I used the Behavior panel for it.   I don't know how to work onLoadInit() into the code or if I need to do something completely different than what I have below in order to make onLoadInit() work. 


on (release) {

    //load Movie Behavior
    if(this.mcContentHolder == Number(this.mcContentHolder)){
        loadMovieNum("menu.swf",this.mcContentHolder);
    } else {
        this.mcContentHolder.loadMovie("menu.swf");
    }
    //End Behavior

Do I need to replicate the navigation menu on every single page or can I leave it the way it is now which is just on the main page?

Nicole

kglad
Community Expert
Community Expert
June 4, 2009

you can cross-fade _levels and adapt what you're doing to a cross-fade but you can't prevent a momentary flash that will appear before you can control the newly populated _level and working with _levels and cross-fades is more difficult than working with target movieclips.

so, you should load into target movieclips instead of _levels.