Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Will do thanks
Find more inspiration, events, and resources on the new Adobe Community
Explore Now