Hello,
I have set up a very basic fla with 3 bts and 3 dummy swfs. Each bt loads an swf into a mc called 'loadmc' an empty container on the stage and fades it in using TweenLite.
But i ran into a roadblock here. i was thinking of makeing it function like this:
a) load 1st swf
on click fade out 1st swf and load 2nd swf.. and so on..
therefore, since i'm not well versed with as3, i wrote a fairly simple piece of code :
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;
TweenPlugin.activate([AutoAlphaPlugin]);
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.MouseEvent;
var loader:Loader = new Loader();
addChild(loader);
bt1.addEventListener(MouseEvent.CLICK,onLoadClick);
function onLoadClick(evt:MouseEvent):void
{
loadmc.alpha = 0;
loader.load(new URLRequest("loadtest1.swf"));
loadmc.addChild(loader);
TweenLite.to(loadmc, 0.8, {autoAlpha:1, ease:Sine.easeIn});
}
bt2.addEventListener(MouseEvent.CLICK, onLoadClick2);
function onLoadClick2(evt:MouseEvent):void
{
loadmc.alpha = 0;
loader.load(new URLRequest("loadtest2.swf"));
loadmc.addChild(loader);
TweenLite.to(loadmc, 0.8, {autoAlpha:1, ease:Sine.easeIn});
}
bt3.addEventListener(MouseEvent.CLICK, onLoadClick3);
function onLoadClick3(evt:MouseEvent):void
{
loadmc.alpha = 0;
loader.load(new URLRequest("loadtest3.swf"));
loadmc.addChild(loader);
TweenLite.to(loadmc, 0.8, {autoAlpha:1, ease:Sine.easeIn});
}
However, i cant get the intended logic to execute here. With the above it just loads 1 swf into the container and fades it in, but in between the 2nd swf and the 1st there should be fading happening with each other (1st swf and 2nd swf), instead there's just a jump... :S
Since i am new to as3 and still learning, any help would be appreciated please. thanks.