Hi all,
I’m putting my site together, and I want to load/unload external SWFs for each section of the site. When the site initially load, I have this even listener in place to detect when all of the layout animations finish:
f.addEventListener("onComplete", menuLabelsDone);
function menuLabelsDone():Void {
_root.contFrameIn.contentLoader.currMovie = "front";
contFrameIn.contentLoader.loadMovie(_root.contFrameIn.contentLoader.currMovie+".swf");
f.start(true);
}
Now, when the user clicks a button, I want whatever section SWF that is loaded to fade-out, unload, the container MCs to resize and finally the new SWF to load, and here’s the code I put together for it (without the new loading function):
contFrameIn.mainNav.profileTrigger.onPress = function() {
function currMovieFadeTwo():Void {
var f:Fuse = new Fuse();
f.autoClear = true;
f.push (
{target: _root.contFrameIn.contentLoader.currMovie, _alpha: "0", time: .6, delay: .1, ease: "easeInExpo"}
);
f.start();
}
currMovieFadeTwo();
f.addEventListener("onComplete", currUnloadTwo);
function currUnloadTwo():Void {
contFrameIn.contentLoader.unloadMovie(_root.contFrameIn.contentLoader.currMovie+".swf");
f.start(true);
}
currUnloadTwo();
f.addEventListener("onComplete", profileTween);
function profileTween():Void {
var f:Fuse = new Fuse();
f.autoClear = true;
f.push ({delay: .2});
f.push ([
{target: [contFrameOut.contFrameOutMC, contFrameOut.dropShadow], _width: 826, _height: 420, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.contFrameInMC, _width: 806, _height: 400, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.navBG, _y: -190, _width: 786, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.wordmark, _x: -382, _y: -168, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.vertBar, _x: -299, _y: -167, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.taglines, _x: -298, _y: -170, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.taglineMask, _x: -300, _y: -156, time: .65, ease: "easeOutExpo"},
{target: contFrameIn.mainNav, _x: 136, _y: -162, time: .65, ease: "easeOutExpo"}
]);
f.start(true);
}
profileTween();
}
The problem I’m running into is that I’m getting an error from the Zigo Engine that it can’t find the target for the fade-out (first Fuse in the onPress function). I don’t want to name the SWF itself as a target because the whole point is that it’s supposed to affect whatever the current movie that is loaded is, not a specific one by instance name. Anyone know how I can get this working the way it should?
Thanks in advance!