Need some help with transitions

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:

  1. 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:)

Do you just want to replace the previous swf with the new one?

Yeah but I want to have it mask over the last clip. So it loads over the prev clip.

Thanks

untested, but I would imagine you could declare a variable “i” as 1, and then use this on your buttons:

on (release) {
i++
container1.loadMovie(“section1.swf”);
container1.swapDepths(i);
}

Thanks Adam14,

I am moron, how do you set the var i as 1, and where do I put it? lol

Thanks

in your first frame put this:

i=1

that decalres the variable “i” as “1”

Ok I tried that and it so close:) But when you go out of order some happens wiith stack?

Take a look

I think you want something like this, code is commented:)

scotty(-:

SCOTTY, YOU ARE THE BEST!!! PERFECT ONCE AGAIN!!! thanks so much for taking time out for me.

You’re welcome=)

Hey Scotty,

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?

Thanks

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:

allTheButtons_mc.swapDepths(i+1);

scotty(-:

Thanks Scotty,

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;
}
}
}

Thanks Scotty!!!

This is what I had in mind. Select all your buttons and make them a movieclip with the instancename “nav”.
Change your code in this:

var i = 1;
nav.bt1.gotoAndStop(3);//changed the path
holder1.loadMovie("holder1.swf");
for (i=1; i<=5; i++) {
	btn = this.nav["bt"+i];
	btn.i = i;
	btn.onRollOver = function() {
		this.gotoAndStop(2);
	};
	btn.onRollOut = function() {
		this.gotoAndStop(1);
	};
	btn.onRelease = function() {
		i += 5;
		//changed the path for the next two lines
		this._parent._parent["holder"+this.i].loadMovie("holder"+this.i+".swf");
		this._parent._parent["holder"+this.i].swapDepths(i);
		this._parent.swapDepths(i+1);//added this line
		setButtons(this.i);
	};
}
function setButtons(k) {
	//changed the path (nav)
	for (j=1; j<=5; j++) {
		if (j != k) {
			this.nav["bt"+j].gotoAndStop(1);
			this.nav["bt"+j].enabled = 1;
		} else {
			this.nav["bt"+j].gotoAndStop(3);
			this.nav["bt"+j].enabled = 0;
		}
	}
}

I didn’t test it, if it doesn’t work, post your fla;)

scotty(-:

Man O Man you are good!!:slight_smile: Thanks for all you help on this, and getting back to help me so fast.

Are you on a Mac?

No problem, glad I could help:)
And yep, it’s me and Maccie;)

scotty(-: