Nice transitions? You probably all will know this!

I think this will be actionscript that’s why I am posting here but I might be wrong. I know little about actionscript so If you do have time for a response, a little bit of explaining might be required on your part Here’s the scenario…

I would like to be able to make it so that the main content of my site slides in and out as buttons are pressed - e.g. I am currently in the homepage section, I press contact button, the homepage slides out of view and contact page glides into place. I now press links, contact page slides out and links page slides into place. Get what I mean? I think it would be called transitions. I hope I make myself clear. (it doesn’t have to be sliding, the pages could fade away or whatever I choose. I just want to know how to control it all.

An example would be the following site:

http://www.realitydesigns.co.uk/

Any pointers towards tutorials, old unwanted FLAs would be fantastic. I just cant work it out at the moment. My brain is slowing down.

Thank you.

Yeah, I know how to do that, I think I’ve explained it to a member here … let me see if I can find it back.

Voetsjoeba,

Thanks for that. This really does have me stuck at the moment. I have posted similar questions but just can’t find answers. How difficult is it?

The user I was speaking about seems to have vanished :stuck_out_tongue: I’ll tell you here then. It’ll take a while, so hang on.

Thank you for your time.

Ok, so here’s the system:

Every external swf will have an intro part, a part that shows the content, and an outro. So let’s say frame 1-77 intro, 78 stop, 79-160 outro for example. This will work together with the buttons on the main swf: when we click one of those buttons, we want the swf to play it’s outro. Let’s start from there an build our way to the final script.

So let’s say we have a movieclip called container on the main swf in which we load the sections. Then the script for the buttons will be:


on(release){
_parent.container.play();
}

But, we only want it to play when it has reached it’s frame at where it stops. How do we know ? We’ll place a variable in the external swf that holds the framenumber of the frame at which it stops, and then we’ll ahve the button check if it matches with it’s currentframe.

So add this to the first frame of every swf:


midframe=78

Of course, I’m just taking 78 as example value here. And place this on your button


on(release){
if(_parent.container._currentframe == _parent.container.midframe){
_parent.container.play();
}
}

Ok. Now, we want to load another movie to container when the current section playing it’s outro has reached it’s last frame. But the external swf doesn’t know what button we clicked and therefore neither what swf it has to load. So we’ll store a variable in _root, so the section can access it too, that stores the movieclip to load:


on (release) {
	if (_root.currMovie == undefined) {
		_root.currMovie = "work";
		_parent.container.loadMovie("work.swf");
	} else if (_root.currMovie != "work") {
		if (_parent.container._currentframe == _parent.container.midframe) {
			_root.currMovie = "work";
			_parent.container.play();
		}
	}
}

And at the last frame of each of your swfs:


_root.container.loadMovie(_root.currMovie+".swf");

Notice that we are always loading [_root.currMovie].swf. Therefore, you must make sure that you only give the names of your swfs to _root.currMovie when pressing the buttons. So if you have the swfs a.swf, b.swf and c.swf for example, you must give _root.currMovie the values a b and c when pressing the buttons. Otherwise it will try to load non-exisiting swfs.

I hope I didn’t forget anything.
*Fixed a typo.

Thanks, wow that’s a lot of typing. I’ll take my time with it and have a go. I’ll write back and let you know how I get on.

Thanks again.

Voetsjoeba,

Once again, i’d like to thank you for the time you have spent.

I have made my main movie with two buttons and two external movies with intro and outro animation as you suggested. I have had a lot of problems getting this to work so I hope you don’t mind if I send in the three FLA files for your attention. Perhaps if you put in the required actions for me then I will study this and put it inside my tutorials folder for future reference. I removed all but the midframe actionscript and stop actionscript in the external movies to keep things nice and clean. I have also placed an empty movie clip in the main movie and called it container.

If I can impose further on your time and ask you to do this I would be most grateful. Sorry for being so inept at actionscript. I do intend to purchase some books and make a serious study of the subject.

Many kind regards.

Here are you fixed files :slight_smile:

And externalone …

And externaltwo :slight_smile:

Works perfectly! At last a way to do it. Thank you very much for your patience.

You are the MAN. :slight_smile:

I’ll be using it in my next project, a complete reworking of the following site I made for a band.

http://www.spree.us

No problem =)

Thank you sooo much. I read this thread and it Helped me soooooooo much! I’ve been trying to get that to work for a while now. Now I get it. Thanks a TON!

You 0wn! :thumb::thumb:

Man, good thing we made you a mod, voets… :smiley:

Thanks :beam:

I’m really glad that I started this thread, not only has it helped me but also others including blackshadow.

I don’t know if anyone is interested but it wasn’t in vain, as I actually used the advice I recieved here to produce the following site:

http://www.galaxymusic.co.uk/spree.html

Don’t laugh, it’s only my second site. The first site I made can be seen by taking off the spree.html section from above.

Thanks once again.

hi I have done the smooth transitions tutorial. I want to use movieclips instead of buttons how would i do this? also when I use buttons the file doesnt work, it will load the first swf file only