Hi,
I’m trying to create a menu device that will enable me to essentially fade between different external .swf’s
I’m not that up on my script yet, so found some that should suit in the forums but I’m having a slight problem.
I have my main FLA that has an empty container (#1) in it that pulls in an external .swf. depending on what button (MC’s) you press and fades it in and out (the external .swf’s have been tweened to fade in and out with a stop in the middle). That works fine.
However one of the external .swf’s has its own menu device to swap between further external .swf’s that containing fading/blending images that load into its own container (#2). I’m using the same code as in the main FLA but have taken out the _root. This all seems to work fine except that when I click a different button (category) in the main FLA, before it fades the main container (#1) in the main FLA, it dumps the external .swf in the container which sits inside the loaded .swf, instead of fading the thing as a whole.
I hope that makes sense, and below is the script I have in both the main container and the script thats on the container in the external .swf
I’m using Flash 8 but going to be saving out to 7
Please Help!!!
Main container script…
_root.container.loadMovie(“section1.swf”);
// //////////// NAVIGATION FUNCTION = getIt /////////////
// ///////////////////////////////////////////
function getIt(t) {
trace(t);
_root.onEnterFrame = function() {
trace(“step1”);
loadMovie(t._name+“.swf”, _root.container);
_root.onEnterFrame = function() {
bl = _root.container.getBytesLoaded();
bt = _root.container.getBytesTotal();
trace(bl+" “+bt);
if (bl == bt && bt>0) {
_root.container.onEnterFrame = function() {
this._alpha += 5;
if (this._alpha>=100) {
this._alpha = 100;
trace(“done”);
delete this.onEnterFrame;
}
};
}
};
};
}
function getIt(t) {
_root.container.play();
_root.lastFrame = _root.container._totalframes;
t.onEnterFrame = function() {
t.goNow = _root.container._currentframe;
if (t.goNow>=_root.lastFrame && t.goNow>1) {
loadMovie(t._name+”.swf", _root.container);
delete t.onEnterFrame;
}
};
}
section1.onRelease = function() {
t = this;
getIt(t);
};
section2.onRelease = function() {
t = this;
getIt(t);
};
section3.onRelease = function() {
t = this;
getIt(t);
};
section4.onRelease = function() {
t = this;
getIt(t);
};
section5.onRelease = function() {
t = this;
getIt(t);
};
section6.onRelease = function() {
t = this;
getIt(t);
};
section7.onRelease = function() {
t = this;
getIt(t);
};
section8.onRelease = function() {
t = this;
getIt(t);
};
External container script
container2.loadMovie(“acsub1.swf”);
// //////////// NAVIGATION FUNCTION = getIt /////////////
// ///////////////////////////////////////////
function getIt(t) {
trace(t);
onEnterFrame = function() {
trace(“step1”);
loadMovie(t._name+“.swf”, container2);
onEnterFrame = function() {
bl = container2.getBytesLoaded();
bt = container2.getBytesTotal();
trace(bl+" “+bt);
if (bl == bt && bt>0) {
container2.onEnterFrame = function() {
this._alpha += 5;
if (this._alpha>=100) {
this._alpha = 100;
trace(“done”);
delete this.onEnterFrame;
}
};
}
};
};
}
function getIt(t) {
container2.play();
lastFrame = container2._totalframes;
t.onEnterFrame = function() {
t.goNow = container2._currentframe;
if (t.goNow>=lastFrame && t.goNow>1) {
loadMovie(t._name+”.swf", container2);
delete t.onEnterFrame;
}
};
}
sub1.onRelease = function() {
t = this;
getIt(t);
};
sub2.onRelease = function() {
t = this;
getIt(t);
};
sub3.onRelease = function() {
t = this;
getIt(t);
};
sub4.onRelease = function() {
t = this;
getIt(t);
};
sub5.onRelease = function() {
t = this;
getIt(t);
};
sub6.onRelease = function() {
t = this;
getIt(t);
};