A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: fading in/out movies on different levels?

  1. #1
    Member
    Join Date
    Aug 2001
    Posts
    34

    fading in/out movies on different levels?

    What script would I attach to a button on _level0 to tell a movie on _level1 to goto a frame label (causing it to fade out and unload itself) and then when its faded away, load a new movie into _level1? I'm attempting to have one movie fade into the next when different buttons are clicked.

  2. #2
    Esquire Frank DeRosa's Avatar
    Join Date
    Dec 2002
    Location
    the Matrix
    Posts
    144
    To address another level, you put the level in front of the command.

    On (release){
       _level1.gotoAndPlay("frameLabel" );
    }


    Frank

  3. #3
    Member
    Join Date
    Aug 2001
    Posts
    34
    Thats great, thank you. Now from there, how do I make the movie pause while level 1 fades away and uloads itself, then have a new movie load into level 1?

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I would load the movie into an empty mc "mcMovie". Then you can do the fading and unloading and loading. Try this or play around if it does not immediately work. Check out my site:
    http:can_info_guide.tripod.com/
    for fadings using as.

    PHP Code:
    function fadeOut(){
         
    fadeSpeed=20;
         
    timeSpeed=20;
         
    myPauseOut=new Object();
         
    myPauseOut.interval=function(){
            if(
    mcMovie.newClip._alpha>=100-fadeSpeed){
                
    mcMovie.newClip._alpha-=fadeSpeed;
            }else{
                
    mcMovie.newClip._alpha=0;
                
    mcMovie.loadMovie(newMovie.swf");
                mcMovie._alpha=0;
                clearInterval(myTimerOut);
                fadeIn();
            }
          myTimerOut=setInterval(myPauseOut, "
    interval", timeSpeed);
    }

    function fadeIn(){
        myPauseIn=new Object();
         myPauseIn.interval=function(){
            if(mcMovie._alpha<=100-fadeSpeed){
                mcMovie._alpha+=fadeSpeed;
            }else{
                mcMovie._alpha=100;
                clearInterval(myTimerIn);
            }
         myTimerIn=setInterval(myPauseIn, "
    interval", timeSpeed);
    }

    On (release){
       mcMovie.gotoAndPlay("
    frameLabel");

    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Member
    Join Date
    Aug 2001
    Posts
    34
    Thank you for your time and script. You'll have to excuse my ignorance, but I am suposed to place that script on the button?

  6. #6
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I just found one mistake in the buttonscript

    On (release){
    _root.mcMovie.gotoAndPlay("frameLabel");
    }
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Although I answered your e-mail I like to answer the question here too. The script for fading (I hope it works!) is best on the main timeline the same framenumber where the button is located though it should work too when the script is in frame 1. The on(release) has to be in the button of course.
    - The right of the People to create Flash movies shall not be infringed. -

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