PDA

View Full Version : loading movie clips



mariam
September 30th, 2003, 08:08 AM
hi
i have a movie and want to load external swf files into the middle section. my navigation allows users to access from 10 buttons. i can load the swfs either thru createEmptyMovieClip, or loadmovieNum. but i can't seem to control the levels. that is previous movies can be seen underneath the new loaded movie...
i need to clear previous movie clip before loading the next, i think?? anyone got any ideas? here is createEmptyMovieClip code.


this.createEmptyMovieClip("generic_mc",2);
generic_mc.x=0;
generic_mc.y=62;
onedegree_btn.onRelease = function() {
generic_mc._x =0;
generic_mc.loadMovie("onedegree.swf",1);
}

thanks for any help.
maria

eki
September 30th, 2003, 09:03 AM
Hi,

Just use the same 'container' allthe time and one loaded movie will replace the previously loaded one:





this.createEmptyMovieClip("container_mc",2);
container_mc.x=0;
container_mc.y=62;
onedegree_btn.onRelease = function() {
container_mc.loadMovie("onedegree.swf",1);
}


nextButt_btn.onRelease = function() {
container_mc.loadMovie("nextMovie.swf",1);
}


SHO

Voetsjoeba
September 30th, 2003, 01:57 PM
generic_mc.loadMovie("onedegree.swf",1);

The 1 is indicating a level to load to using loadMovieNum, but you're specifying generic_mc to load to using loadMovie too. I don't know what Flash will do with this, but it's safer to just use


generic_mc.loadMovie("onedegree.swf");

Not 100% on this, so I might be wrong.

mariam
September 30th, 2003, 06:38 PM
thanks eki and voetsjoeba. i just woke up, so i'll try it right now and let you know if it works.
m

mariam
September 30th, 2003, 07:05 PM
yes it works. except for one little detail. which i find strange so i'll tell you. i have an internal movie clip loaded in the same spot that always remains underneath all the external movie clips, which load perfectly now and replace each other. Is there anyway of telling an internal movie clip what level to load into?
but hey thanks anyway, i can always work around this.
maria

eki
October 1st, 2003, 06:02 AM
You're welcome

Voetsjoeba
October 1st, 2003, 07:19 AM
Well you can always use loadMovieNum to load a swf to a level instead of to a movieclip. If you don't use loadMovieNum you can also use swapDepths to change the depths of the movieclip you're loading into :)