dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: fading transition

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    209

    fading transition

    I know this question has been asked a million times but I didn't understand it the other threads. Ok here's what I want to do. I have a video index.html or index.swf. Ok now there have buttons on the top of the movie and text in the middle. Ok when I go to another page, for example contact.swf or contact.html I want the text from the index file to fade out, not the buttons though, and have the text of the contact file fade in where the other text was. Ok can someone explain how I do this? Please explain it as step by step and simple as you can, because i'm not good at actionscript. If there is a simpler way to do it, as have evrything in the same file or something, please tell me too. I don't care if i have to redo everything I just want to have this simple transition.

  2. #2
    Slackware 9.0 Runes_Tooth's Avatar
    Join Date
    Mar 2002
    Location
    Crono Triggyarr
    Posts
    508
    Just change the alpha of the text from 100% to 0% at different intervals (90%, 80%, etc) between the frames displaying the text.
    That's the simplest way I can think of.

    If you do it this way, I recommend using a different scene for each 'page' of text and having the first frames for each scene fade the text in (0% alpha to 100%) and then have the movie stop, and then the last frames fade out. (100% to 0%). For whatever button was pressed, have it change a certain variable to a number, and put code to check that variable and go to a certain scene for different numbers.

    So if you were to use the variable "page" and you were to click a button to go to another scene, it would look like this:
    Code:
    on(release){
         _root.page = 2;
         _root.play();
    }
    And then have this on the last frame of every scene:
    Code:
    if (_root.page == 2){
        gotoAndPlay("scene2",1);
    }

    I hope that makes sense, it's 2 AM here. I'm a little...well...zzzzz

  3. #3
    Senior Member
    Join Date
    Aug 2001
    Posts
    209

    problem

    Ok, so if the page is home. When i click the contact button home will fade out and contact will fade in , cuz contact is in the code. but lets' say ic lcik another button, like "about". Now if I click about, home fades out but won't it still laod contact becuase contact is in the code???? maybe I'm miising something here.

    Also, I understand how to get thigns to fade in and out but I don't understand this part
    For whatever button was pressed, have it change a certain variable to a number, and put code to check that variable and go to a certain scene for different numbers.
    can you explain that further.

    One mroe thing in my video I wanted the buttons to stay and only the text to fade, doing it this way won't the buttons fade with the rest of the scene.

  4. #4
    Slackware 9.0 Runes_Tooth's Avatar
    Join Date
    Mar 2002
    Location
    Crono Triggyarr
    Posts
    508
    My code example was for only one change. Just add more for every scene.

    Code:
    if (_root.page == 2){
        gotoAndPlay("scene2",1);
    } else if (_root.page == 3){
        gotoAndPlay("scene3",1);
    }

    And about the buttons fading, you only change the alpha of the text.

  5. #5
    Senior Member
    Join Date
    Aug 2001
    Posts
    209
    can you please break down the code for me. Like what do those numbers mean after the scene and stuff. i don't know much actionscript and i don't how to use thta to get the transition to work. I undersatnd the faidn and everything just not he that code. please break it down for me.

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