Transitions Between External SWFs (two containers)

Hello, I have a big problem, maybe someone can solve it.

I’m using Kirupa’s tutorial about “Transitions Between External SWFs” (http://www.kirupa.com/developer/mx2004/transitions2.htm)
and there is a code with 1 “container”, is there any way to add another one?
eg. I need “container” for Layer2 … and another one “container2” for layer 25
(I needed to arrange the layers, Layer2 for Movie1_mc and Layer25 for Movie2_mc - both must appear on the same time)
How do I need to change code for that? I’m not very well with programing.

Below code from Kirupa’s tutorial:

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = “main”;
container.loadMovie(“main.swf”);
} else if (_root.currMovie != “main”) {
if (container._currentframe >= container.midframe) {
_root.currMovie = “main”;
container.play();
}
}
}

p.s sorry for my english.

Best Regards, Pepe.

Hey Pepe,

I just followed the exact same tutorial for the site I’m currently working on and managed to get it working perfectly believe it or not!..Well considering I’m pretty bad at coding too. Lol.
I don’t understand exactly what your trying to do, so it’d be best to upload the file (or a link) so I could have a look at it, but for now I will suggest the following…

Assuming you need 2 transitions to play for the 1 button (Code on “main” button):

on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = “main”;
container.loadMovie(“main.swf”);
} else if (_root.currMovie != “main”) {
if (container._currentframe >= container.midframe) {
_root.currMovie = “main”;
container.play();
}
}
}
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = “main2”;
container2.loadMovie(“main2.swf”);
} else if (_root.currMovie != “main2”) {
if (container._currentframe >= container2.midframe) {
_root.currMovie = “main2”;
container2.play();
}
}
}

As simple as that I’d assume. Just a matter of duplicating the code and changing targets. Then all you’d need to do would be to make sure your “Registration Points” are alligned between External SWF’s and Container, or adding a Mask layer above each container (which will also play content in position according to location of “Registration Point”)…yes, you can actually add Masks to each container…They work great on my site!

Give that a shot and let me know how you go :slight_smile:

**Dallas. **

Hello Dallas, thx for a reply.
So, I need to explain :slight_smile:

In scene we have empty MC named “container”.
I’ve added another MC named eg.“container2”

(see attachments)

“container2” and “container” must be in the same frame.

About mechanics:

  • Animation start: SWF file (intro.swf) loads to “container2” when animation in that MC ends, Buttons appears.
  • Then after hiting one of buttons other SWF’s files loads to “container”. (NOT “container2”)

Of course every thing is very easy, but I need transition beetwen “container2” and “container”. :wink: With original code transition is from SWF to SWF from the same MC “container”. What about two different MC’s ???

p.s. Sorry for my English.
Best Regards, Pepe.

Ok, I kind of see what your trying to do. Just to clarify though, will you give users the option to access “container2” (intro sequence) at anywhere throughout the site, or do you want that to play once and once only?

I also have an intro sequence for my current interface aswell, and what I’ve done is created 2 Scenes, rather than 2 containers.

Scene 1: Plays intro animation. Ie: Site Elements forming and buttons fading in. (and whatever animation “intro.swf” contains for your site)

Scene 2: Plays 1st selection in “container” MC with all site elements static (still), and having already been animated in Scene 1. The first SWF to load in Scene 2 will automatically play with the following code in frame 1 (of Scene2):

_root.currMovie = “your_first_section_name”;
container.loadMovie(_root.currMovie+".swf");

So in brief, what you need to do is create another Scene (Scene 1) in your main interface, then copy all frames from “intro.swf” across to this, then you should be right. I know it’s a pain, but it’s a small price to pay for the result you want. You could also include a “Skip Intro” button in Scene 1 that contains: On Release, gotoandPlay “Scene2” code on it.

Try that and let me know how you go.

Regards,
Dallas.

**To add one more point: **

It is also possible to “Paste In Place” (Ctrl+Shift+V) between Scenes. Therefore any buttons, borders or elements you want to appear in Scene 1, can be copied from the ones already created in (soon to be) “Scene 2”. Once pasted, you can then tween them or fade them in at will (in Scene 1) knowing that they’ll end up in exactly the same position as Scene 2. :slight_smile: