Tween fade-in problem
Hi-
I am trying to get all sections (brought in using UILoaders) of my website to fade in when clicked on. I started out with making the main image load in when the user navigates to the site and that works. However, when I try to apply it to the other sections, it fades it but it stays faded part way.. it doesn't come to 100% opacity. I can't figure out what the problem is. I'm posting my code here. If someone can tell me what I'm doing wrong, and show me how to fix it, that would be really helpful! Note: The part that isn't fading in properly is "sectionLoader"; the "main_mc" part is the initial home image and that works fine but when navigating back to home from another page (using nav buttons), the same thing happens with it not loading properly:
//Tween info
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.Event;
//Main image fade in
content_mc.main_mc.addEventListener(Event.COMPLETE, fadeIn);
sectionLoader.addEventListener(Event.COMPLETE, fadeIn);
function fadeIn(e:Event):void
{
var myAlphaTween:Tween = new Tween(content_mc.main_mc,"alpha",Regular.easeOut,0,1,1,true);
var myAlphaTween2:Tween = new Tween(sectionLoader,"alpha",Regular.easeOut,0,1,1,true);
}
//LISTEN FOR CLICK OF BUTTONS
function moveContent(theXPosition:Number, theYPosition:Number, theSection:String):void
{
trace("X: "+theXPosition);
trace("Y: "+theYPosition);
var myxTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x,theXPosition,1,true);
var myyTween:Tween = new Tween(content_mc,"y",Regular.easeOut,content_mc.y,theYPosition,1,true);
sectionLoader.source = theSection;
}
home_btn.addEventListener(MouseEvent.CLICK, homeClick);
function homeClick(e:MouseEvent):void
{
trace("homeClick");
moveContent(-2227.55,-706.95,null);
nav_lines.x = 162.80;
nav_lines.y = 151.35;
}
abt_btn.addEventListener(MouseEvent.CLICK, abtClick);
function abtClick(e:MouseEvent):void
{
trace("abtClick");
moveContent(440.70,-2652.90,"about.swf");
nav_lines.x = 162.80;
nav_lines.y = 177.35;
}
port_btn.addEventListener(MouseEvent.CLICK, portClick);
function portClick(e:MouseEvent):void
{
trace("portClick");
moveContent(440.70,735.10,"portfolio.swf");
nav_lines.x = 162.80;
nav_lines.y = 204.35;
}
res_btn.addEventListener(MouseEvent.CLICK, resClick);
function resClick(e:MouseEvent):void
{
trace("resClick");
moveContent(440.70,-358.60,"resume.swf");
nav_lines.x = 162.80;
nav_lines.y = 229.35;
}
con_btn.addEventListener(MouseEvent.CLICK, conClick);
function conClick(e:MouseEvent):void
{
trace("conClick");
moveContent(436.70,-1480.15,"contact.swf");
nav_lines.x = 162.80;
nav_lines.y = 256.35;
}
Any response would be greatly appreciated. Thanks!!
*Pooja*