AS3 TweenMax Fade Between Sections of a Site
// USEAGE
// transitionTo(myMC);
var currentSection:MovieClip;
var nextSection:MovieClip;
function transitionTo(_nextSection:MovieClip):void
{
nextSection = _nextSection
currentSection ? fadeOut() : fadeIn();
function fadeOut():void
{
TweenMax.to(currentSection, .5, {autoAlpha:0, onComplete:fadeIn});
}
function fadeIn():void
{
TweenMax.to(nextSection, .5, {autoAlpha:1, onComplete:swap});
}
function swap():void
{
currentSection = nextSection
}
}