First to load a .swf file into a Movie Clip container.
I have flash MX so I hope the menu's are the same on your
version.
1.Open a New file.
2.Open the Insert menu select New Symbol.In the name field call
it empty_mc and for Behaviour select Movie Clip. Press OK.
3.Open the Library. You should see an icon for the empty_mc
Movie Clip Symbol. Drag it onto the stage.
4.It should appear as a white dot. Select this dot open the
Properties panel and give it an instance name call it
mcHolder.
Now select the first frame of the main timeline.
Open the Actions panel and add the following actionscript.
stop();
loadMovie("myMovie.swf","mcHolder");
Save your file call it mainMovie then test movie.
note *****In the above example you will need to change
"myMovie.swf" to the name of a .swf file you would like to
load. It must be in the same directory as your mainMovie.swf.
Hope you can understand this.
There are lots of tutorials on how do do this that give you
a visual as well.
As for a working example of a mutiple .swf Movie. I will
make up a small project from 4 to 5 .swf files. And post it
back here.
But BEFORE I do .... what version of flash do you have???
One other question... the .swf that we would like to load into the movie clip - can this be any size?? very small if needbe and it will load directly into this location.
Looking forward to seeing what you put together and trying it out!
Thanks again
The size can be what ever you want. You should try it out.
The small white dot on the Stage that represents you Movie
Clip holder can be draged to where you want it.
Best way is to try it.
I will make up an Example. It will be simple graphics.
so you can understand the ideas withou being cofused by a
complex looking movie.
Well here is an attached zip file it contains the first basic
steps into preloading mutiple .swf file.
If you look it over play around with it maybe experiment
by loading some of your own .swf file and see the results.
Remember the .swf files you are loading must be in the same
directory as the MainMovie.swf that loads them.
Of course this is just how I have this example to keep it
simple. You can have your .swf's in other directories as
long as you use the correct path to them.
Post back when you want more ... I will add more to it.
This way if you want you could work towards a more complex
Movie with preloader bars and All the Movie Clips
controling each other and sending each other data.
It would take very little time for you to get to that point.
Then you can use this knowledge in your own Movies.
Part two ...
loading your .swf files from buttons and controlling your
loaded Movie Properties with buttons.
Milosav
If you had a Movie Clip instance with the instance name
mc_holder1.
Then you can change it's x y position with the script.
mc_holder1._x=100;
mc_holder1._y=100;
or you could use a loop like this to make mc_holder1 move
cross the Stage from left to right.
for(i=0;i<800;i++)
{
mc_holder1._x=i;
}
As you can see once you can manipulate your Movie Clip instances
you can now create a motion tween without using more than 1 Frame.
If you load a .swf into a Movie Clip instance and you try and
set it's properties before enough data is loaded, you will
create all sorts of buggy problems. So before you change any
Properties you must make sure that enough data has been loaded.
This leads to a pre-loader or some sort of bytesLoaded check.
Thanks for the file Milosav..I have Flash MX as well.
I was wondering how to preload an swf that you are going to load into your main movie...?
Also off the subject, I'm looking for a very simple Flash MX preloader...I don't want to use "If Frame Loaded" anymore and I can't find a simple preloader that works.
Milosav, good morning!
I am on a Mac - is there anyway I can still get those files from you?? I'm very interested in playing around with this later after work. Thanks a million!
Nicole
justplainsoccer here is part Two it is an extension of
part one the only real addition is the buttons some to
load the three .swf's and some to change the Properties
of the Movie Clip instances that they are loaded into.
You should not find it much of a jump from part one. Only
the MainMovie is different.
Without moving from Frame 1 in MainMovie we load in three
external .swf files, move them, alpha them and more.
foochuck If you have a main movie called MainMovie and an
external .swf file being loaded called Movie1.swf.
In Movie1 leave Frame 1 blank except for a stop(); action.
Start the rest of your Movie on frame two.
Then in your main movie something like the following script.
Where mc_holder is the Movie Clip instance you are loading into.
loadMovie("Movie1.swf","mc_holder");
loaderInterval=setInterval(loadChecker,100);
function loadChecker(){
I just hit the wrong key ... so where were we ....
Hi,
justplainsoccer here is part Two it is an extension of
part one the only real addition is the buttons some to
load the three .swf's and some to change the Properties
of the Movie Clip instances that they are loaded into.
You should not find it much of a jump from part one. Only
the MainMovie is different.
Without moving from Frame 1 in MainMovie we load in three
external .swf files, move them, alpha them and more.
foochuck If you have a main movie called MainMovie and an
external .swf file being loaded called Movie1.swf.
In Movie1 leave Frame 1 blank except for a stop(); action.
Start the rest of your Movie on frame two.
Then in your main movie something like the following script.
Where mc_holder is the Movie Clip instance you are loading into.
//start movie load
loadMovie("Movie1.swf","mc_holder");
//set an interval that will call loadChecker() every
//100 milliseconds.
loaderInterval=setInterval(loadChecker,100);
//the function to check the bytes loaded
function loadChecker(){
//check the data transfer
if(mc_holder.getBytesLoaded()>=mc_holder.getBytesT otal() && mc_holder.getBytesLoaded()>0)
{ //if the above conditional statement is "true" then play
//the loaded movie.
mc_holder.play();
//stop the interval that you created
clearInterval(loaderInterval);
}
}
The example files for Part three.. should be posted tomorrow.
They include a very effective method of creating a loader bar
available from anywhere any time.
nklein I only work on windows ... but I am sending files to
another forum member who is on a mac I have assumed from our
conversation that he has been able to use them ?????
Any ideas about that ?????
My files are Flash MX windows version it would seem really
strange to me if you could not share flash files between
Windows and Mac, what about large design teams working on
seperate home platforms ??? Tell me this is not so!!!!!
Thanks for the preloader..I was wondering if you could send me a demo of this preloader in action...I'd like to see how you would use it...I'm just not sure where to place the script you gave me..if I put it in my main movie and the script comes up before the movie is loaded will that cause a problem...Either way I'd like to see a sample of what you explained IF possible.
Sorry to be a pain.I have a couple other questions..I noticed when loading a movie over another the buttons in the background movie still hilite and can be clicked (even though the loaded movie covers the other) is there any way to get around this?
Also I've loaded movie1.swf into movie.swf...movie1.swf contains an audio file that plays..it works when launched by itself but when loaded into movie.swf it doesn't play...what could I be doing wrong? Please advise...