Hello I am trying to build a transition just like this I kinda got working but I need some pros to help me out I had it working with these actions: I load the first swf:
container1.loadMovie(“section1.swf”);
Then my button actions should be:
on (release) {
container1.loadMovie(“section1.swf”);
container1.swapDepths(1);
}
on (release) {
container2.loadMovie(“section2.swf”);
container2.swapDepths(1);
}
on (release) {
container3.loadMovie(“section3.swf”);
container3.swapDepths(1);
}
and so on…
The strange things happen because when I set a mc to a new Depth, the previous mc goes back to its original stacking order which may be under another mc, so it works only in one direction
so now I am trying this:
which=1
on (release) {
this[“container”+which].loadMovie(“section1.swf”);
this[“container”+which].swapDepths(1);
if (which == 1) {
which = 2;
} else {
which = 1;
}
}
I hope this make sense. Here is my new file sorry about the sloppy file:)
Sorry I have one more prob that I have trying to figure out. I have the buttons over the swfs, but when I do this the swfs load over the buttons. Is there a way to have the buttons over the swfs that are being loaded?
It is weird cause they should just be loading in the clips on the layers right? It is not jumping to another level?
The layers in your movie are timeline depths, flash uses -16384 to 0 for them. As soon as use swapDepths, the original stacking order is overwritten. Read senocular’s tut on it:
What you can do is put the buttons in a mc (beware of your paths;)) and swap this one with the holder clips, something like:
I looked at the tut. I am kinda getting it:) But still unclear about the where I put those actions. I really appreciate all your help with this!! I it so close lol…
:h:
var i = 1;
bt1.gotoAndStop(3);
holder1.loadMovie(“holder1.swf”);
//I’ve made a loop so you have all the code at one place, I think you get a better oversight
//I removed the buttons from the “bt” mc’s.
for (i=1; i<=5; i++) {
//to shorten things a bit
btn = this[“bt”+i];
//give each button it’s own id
btn.i = i;
//on roll over
btn.onRollOver = function() {
this.gotoAndStop(2);
};
//on roll out
btn.onRollOut = function() {
this.gotoAndStop(1);
};
//on release
btn.onRelease = function() {
//increase i with 5, so you’re sure there’s nothing in that depth
i += 5;
//here the id is handy (this.i)
//because you’re in the bt mc, this._parent refers to level0;-))
this._parent[“holder”+this.i].loadMovie(“holder”+this.i+".swf");
//the holder is swapped 5 “places” so allways on top
this._parent[“holder”+this.i].swapDepths(i);
//call function setButtons
setButtons(this.i);
};
}
function setButtons(k) {
for (j=1; j<=5; j++) {
//if the button pressed is not this button
if (j != k) {
this[“bt”+j].gotoAndStop(1);
this[“bt”+j].enabled = 1;
} else {
//if the button is pressed is this button
this[“bt”+j].gotoAndStop(3);
this[“bt”+j].enabled = 0;
}
}
}