Skip to main content
Known Participant
February 28, 2014
Answered

Neat way to make stage fade to black?

  • February 28, 2014
  • 1 reply
  • 1736 views

I am currently trying to find some neat way to make everything on the stage fade to black (like the sun was going down). I know i can just create a stage sized black box with an alpha value of 1 and do something like box.alpha += 1/10;. I was just wondering if there is a cleaner way to do this preferably only using actionscript. I appreciate any sort of respond

This topic has been closed for replies.
Correct answer Ned Murphy

Start with an alpha value of 0 for the black area.  You can use the Tween class or any third party tweening engine to gradually change it from 0 to 1.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
February 28, 2014

Start with an alpha value of 0 for the black area.  You can use the Tween class or any third party tweening engine to gradually change it from 0 to 1.

Known Participant
February 28, 2014

Can you tell me why this does not work?

darkness = new mc_dark();
addChild(darkness);
var fade:Tween = new Tween(darkness,"alpha",None.easeNone,0,1,120,true);

It seems to be working all right but the movieclip mc_dark never gets an alpha value of 1, more like 0.5.

Inspiring
February 28, 2014

There's nothing wrong with the code you show - aside from using Adobe's tween classes (which suck). Go to greensock.com and get TweenLite/Max, they are by far the best tween classes for Flash.