dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Cross-fading Loaded Movie Clips

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    3

    Cross-fading Loaded Movie Clips

    I have a movie into which other movies are being loaded. I have one button for each movie.
    My problem is I want to cross-fade movies when the one that is currently loaded is being replaced by another movie. I'm a true novice at ActionScripting so any help given is greatly appreciated.

    Here is the actionscript I have so far:

    button1.onPress=function(){
    loadMovie ("D Wall Animation.swf", "_root.content");
    }

    button2.onPress=function(){
    loadMovie ("R Wall Animation.swf", "_root.content");
    }

    button3.onPress=function(){
    loadMovie ("T Wall Animation.swf", "_root.content");
    }

    button4.onPress=function(){
    loadMovie ("S Wall Animation.swf", "_root.content");
    }

    button5.onPress=function(){
    loadMovie ("S2 Wall Animation.swf", "_root.content");
    }

  2. #2
    Senior Member RangrJay's Avatar
    Join Date
    Sep 2005
    Location
    Las Vegas
    Posts
    163
    so you want one movie to fade out, while the other fades in?
    Xero Patience Studios
    Web Design
    Software Development
    Graphic/Logo Design

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Posts
    3
    Yes. I want one movie to fade out when another one is fading in.

    I just do not want the screen to go white between movies. All movies contain action that brings them on to the stage from white so the previous movie needs to remain for about 10-15 frames before disappearing completely.

  4. #4
    Senior Member RangrJay's Avatar
    Join Date
    Sep 2005
    Location
    Las Vegas
    Posts
    163
    ok, a couple more questions, each movie is already preset with a fade in action?? well, with the way you have it set now, it will probably just straight replace that, that's because you loading the new movie at the same depth. your best bet, put a fade in and fade out on each movie. load them into the next highest depths.

    personally, i don't like loading external movies, just because i change things so quickly on the fly, i like to be able to have complete control over all the mc's in one project.

    my way, i would import each movie, make them their own movieclips, then use the Tween class and function calls to control the fade in and out.
    Xero Patience Studios
    Web Design
    Software Development
    Graphic/Logo Design

  5. #5
    Junior Member
    Join Date
    Apr 2006
    Posts
    9
    Check out this page for a great tutorial on how to cross-fade movie clips.

    http://whatdoiknow.org/archives/001629.shtml

  6. #6
    Registered User
    Join Date
    Sep 2004
    Location
    Los Angeles
    Posts
    86
    load your movies however you are doing it (mc2.loadMovie("movie.swf"));


    ease =1;

    onEnterFrame=function(){
    bytes_loaded = mc2.getBytesLoaded();
    total_bytes = mc2.getBytesTotal();
    if((mc1._alpha>0)and(bytes_loaded == total_bytes)){
    mc1._alpha -= ease;
    }else{mc1.unloadMovie()}
    if((mc2._alpha<100)and(bytes_loaded == total_bytes)){
    mc2._alpha += ease;
    ease = ease*1.5
    }else{ease =1;}
    }


    this is just for crossfading from mc1 to mc2 but it should give you the idea just reverse the mc references to crossfade in reverse.
    Last edited by groovything.com; 05-30-2006 at 05:50 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center