I have several flash swf's that are about 10 - 20 min. each.
I load these in a player that I have created as the user selects
them from a menu in the main swf (a swf player basically). I can
pause start and stop the swf's with no problem, but I can't seem to
get a handle on controlling the audio. I have the audio in the
loaded swf's timelines because I need to sync the audio with the
animation taking place in those swfs. I COULD, take the audio out
of the timeline (after syncing it), and then load it seperately,
but it would be much cleaner for me to just have it in the
timeline. I've resorted to the SoundMixer of the main swf to mute
and change the volume, but I can't get hold of the Sound(),
soundTransforms etc. of the loaded swf. To assign a play location
for the soundChannel I need to access the loaded swf's
Sound().Play() function, but I can't seem to do that. I have
exported the timeline audio in it's actionscript, supplied a name
(same as it's class name), and then tried to access it, but I can't
seem to do it (yes I wrap the loaded.content variable in a
MovieClip cast--that's how I can control the pause and play of the
Tutorials I have found only seem to work with sounds loaded
into variables, and none refer accessing timeline sounds in a
Thanks for helping out. I think you are correct about what I
want to do. Just to make sure though, I also want the audio to pick
back up where they paused the animation if they hit the pause
I've tried SoundMixer.StopAll() but do not get the results I
am looking for. The audio starts for about a half second, but then
shuts off (almost what I want on load, but not quite). Then when
the play button is pushed, the play function is triggered, but no
audio comes out. When the stop function is called, the audio starts
again. This is very strange to me. I have my code posted below.
i think that you may want to place a stop() action on the
first frame of the movieclip's timeline, rather than doing so in
the event handler, this might help keep the file from 'beginning'
to play previous to the command to do so.
add the SoundMixer.stopAll(); call to both the pauseMovie and
make sure that your timeline sounds are set to 'stream'
This is working much better. I had tried using stopAll()
earlier, but because it wasn't set to stream, it did not work
correctly. This made me think I had to dive into the swf and set
sound(), soundTransform() etc. The stop(); in the first frame
didn't seem to do the trick for preventing the audio from starting
up, but I moved the audio one frame down, so the stop() is now
executed before the audio in the swf and that does it.
Thanks so much. It's nice to see a very simple way to solve