A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Fade to Black

  1. #1
    Mustard Man
    Join Date
    Jan 2004
    Posts
    24

    Fade to Black

    Alright, i know how to do almost everything in my movies now... but does anyone know how to fade the screen to black?

    Fade to white would work too...
    Last edited by Icicle69; 03-13-2004 at 10:58 PM.

  2. #2
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    I would say you have quite a bit to learn...

    make a black or white box over the entire stage in the frame that you want to start to fade out from. Highlight it, hit F8, movie clip.

    Make sure it is still highlighted, and hit F9.

    code:

    onClipEvent(load){
    this._alpha = 0;
    this.onEnterFrame = function(){

    if (this._alpha < 100){
    this._alpha += 2;
    }else{
    this._alpha = 100;
    _root.stop();
    delete this.onEnterFrame;
    }
    }
    }



    This will put your black or white clip to 0 alpha and increase by 2 until it reaches 100 (opaque), then it stops the root and deletes the enterframe action (since we are done with it).

  3. #3
    Mustard Man
    Join Date
    Jan 2004
    Posts
    24
    Thanx dude!

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This will fade in the clip, not fade it out!

  5. #5
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    oh jesus. Newb you need better glasses.

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    No my stage is already black or white, all I need to do is basically fade my existing clip to alpha 0... And I don't even need to stop my root timeline which is not running anyways!
    Nor would I'd do it on a "load" clip event!

    Use a little Windex on your's!

  7. #7
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    this guy's stage may not be black or white, that is what he wants to fade to, and in order to do it your way you need everything in one clip or you need to fade everything individually. I put the stop in there incase it was playing.

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