Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : Overrun loading multiple swf's into common shell



H.Lee
2/14/2004 4:59:41 PM
RE: Flash M

I'm loading swf files of roughly 50 image slide shows each into a common
parent "shell" to sequentially playback. Seems simple enough. I have an array
of the swf files. A movieclip symbol target with the following code attached
to it:


onClipEvent (enterFrame

if(_currentframe == _totalframes && _root.beginAt <
_root.movies.length

loadMovie(_root.movies[_root.beginAt], this)
++ _root.beginAt



On the stage above the target movieclip I define the array "movies" and the
counting variable "beginAt" as such

movies = new Array("Octmov.swf", "novmov.swf")
beginAt = 0


It seems that the only swf that plays back is the last one in the array. I
tried listing the swf files in different order and get the sames results. In
my tracing I can see that the Octmov.swf file is loading but it's being
replaced by the novmov.swf file before it even begins to play! In fact, the
loop just races to the end of the array and will only play the last element in
the array regardless of the number of swf files

At the end of each swf file I only have the actionscript to gotoAndStop(1) to
reset the player head. I tried running everything without the stop action at
the end of each loaded swf file and still have the same problem. I've tried
unloading after the loadMovie, to no avail

Thanks much.
Carixpig
2/15/2004 4:06:10 AM
I didn't read your problem properly but it looks like your movies are all
loading as you instruct them to. The reason you only see the last movie is
because each time the next swf in the array loads, it pushes out the previous
one. When you get to the last one, there is nothing to push it out of its level
on the stage so it ends up being the one you see

You need to load each swf into a different level or different movieclip.
Otherwise, only load one at a trime and use actions within the loaded swf to
load the next one fromthe array. You can talk to the main move from externally
loaded swfs by using the _levelN property or by using _root or _parent, I think
AddThis Social Bookmark Button