Using multiple swf's

I’ve not used loadMovie before and I’m confused on how to best approach this:

My friend and I have each made separate swf files. I want to combine these so that his plays first, then mine plays. His ends with a dissolve, mine starts with one - I’d like a little overlap.

Here’s my question: since both are over 500 frames, do I need to use a main timeline that’s 1000+ frames? Can I load both movies and have one wait to start playing?

Any advice on how to best accomplish this would be appreciated.

Thanks in advance

1/make a new movie, 2 keyframes
2/export both your movies (swf)
3/in 1st frame of newMovie, loadmovie your friends swf and add a stio action. this will load in the 1st of the 2 swf’s, which will play (check the export options to ensure autoplay is on)
4/in the last frame of this swf you loaded in should be the action _root.gotoAndStop (2), meaning your 2nd keyframe of the new movie
5/in this 2nd frame, have the loadMovie for your 2nd swf, into the same level as the 1st so that one gets onloaded

This doesn’t overlap though, tell me if it works (just guessing…)

I can help with this, expanding upon Eyez. concept.

Just to fill you in on the nature of the load movie command as I understand it so far:
loadMovie(); can be writen that way, or as loadMovieNum();
loadMovie(); is used when one wishes to load their external swf into a movie clip which is located on the main stage. The target used, is the name of the movie clip to load the swf into. This is really nice because it allows one to move their loaded movies around the screen dynamicaly, while not disrupting the content of the swf. An swf loaded into a movie clip takes on all characteristics and properties of that movie clip including _x, _y, _rotation, _yscale, and _xscale. There are others as well, but those are the one’s most often used.
The downside of the loadMovie(); command is that Mac users can’t see the loaded swf. Considering Mac was one of the few companies to make profit this quarter, and the fact that sales on Mac computers have skyrocketed since Gates dumped all that money into the company, I’d suggest the alternative method for loading movies.
loadMovieNum(); loads external movies into levels. There are ten I believe, and each one can contain an swf file. The problem here is that the loaded swf has a registration point in the upper left corner of the animation field. The movie that you’re loading the swf into also has a registration point there. These two match up when the movie is loaded. So, if you have something on the 0 level, which needs to be seen, like a navigation system, or some other buttons, the loaded swf may cover these up, preventing the user from accessing them.
If one plans ahead when making their project this obstical can be over come, but if this is not taken into consideration ahead of time, it can be a pain in the ass to change later.

Now to the solution for overlap.

for this example we shall call the two loaded movies “one.swf” and “two.swf”. In addition, we have a third movie clip called “fader.swf” which I’ll explain below.
This assumes that you have access to the two origonal fla files for your swfs

The first swf that you have… open it’s fla file and find the frame which is 7 frames from the end.
in the action script layer, enter
loadMovieNum(“fader.swf”){on level1};

The “fader” clip is another fla file. it contains 14 frames, two layers.
In the first frame create a square the same height and width as “one.swf”. use menu option “insert/create motion tween”,
Select frame 14, and choose “insert/key frame” or F8. Select frame 7 and also insert a keyframe.
Selecting frames 1 and 14 use your “effects” panel to change the alpha of the square to 0 on both ends of the tween. What you should have is a square that goes from invisible, to visible to invisible again.
Select frame 7 of the other layer, the blank one, and insert a blank keyframe, using F8 again.
In this frame place the a/s:
loadMovieNum(“two”){on level0};
In frame 14 of this layer, put a stop(); command

So what happens is the first swf loads the fader which starts to become solid. It is covering level0, being on level1, so it blots out that movie. At frame 7 the fader loads the other movie under itself on level0 (which consiquently unloads the first swf, saving processor memory) then between frame 7 and 14 it fades out to transparent revealing the newly loaded swf file below it.

This is problematic if your swf files are large enough. Basicaly, using this setup you’ve only got a second to load the second swf file. It’s unlikely that the swf can load in this amount of time however. So let me know how big they both are. I believe I have an idea around the loading time, but I wont bother if they are small enough. :slight_smile:

Thanks to both!

Here’s what I came up with:

I made a new “MasterTimeLine”. I will use this as an intro/preloader.

Within each file, on frame one I add the following:
//Run if standalone
if (_level0 == this)
&nbsp &nbsp &nbsp &nbsp {this._visible = true;
&nbsp &nbsp &nbsp &nbsp play();}
&nbsp &nbsp &nbsp &nbsp {this._visible= false;
&nbsp &nbsp &nbsp &nbsp stop();}
&nbsp &nbsp &nbsp &nbsp

//Function to initiate playing
function RunMe()
&nbsp &nbsp &nbsp &nbsp {this._visible = true;
&nbsp &nbsp &nbsp &nbsp play();}

Back in MasterTimeLine, I load the movies using loadMovie(swfname, levelnumber). Since they are not on level 0, they do not start but can download. When I need one to start, I call _level#.RunMe();

I use a loop in MasterTimeLine that checks whether _level#._currentframe <= _level#._totalframes -7. The -7 allows me to start the second movie before the first is completely finished, achieving the cross fade effect.

I admit, I’ve only tried it with test clips, but it seems to work fine. Thanks again for the help!

Using functions and all…how come you need to ask about loadMovie :slight_smile:
Glad it worked out, nice coding!