PDA

View Full Version : can't target level with button


akschinas
03-02-2005, 05:36 PM
Hi,

I've gone through the forum looking for the answer to this question, but there doesn't seem to be anything out there. Here's the situation:

1. I have a movie clip on the main timeline
2. The first frame of the movie clip loads another movie in level 1
3. I need a button in the movie clip to stop and/or play the movie loaded into level1.

I put this script on the button inside the movie clip:

on (release) {
_level1.stop();
}

but it doesn't work. Can someone please tell me why? Thanks!

Cota
03-02-2005, 06:52 PM
You have to reference the movieclip in level1. For example:

on(release){
_level1.movieclip.stop();
}

akschinas
03-02-2005, 06:59 PM
Actually, I found out what was happening. I can stop the movie on level1 fine. However, the movie on level 1 is only sound. So when I hit the stop button, the timeline stops, but the audio keeps playing. Do you know how to remedy this?

akschinas
03-02-2005, 07:10 PM
I don't want to attach a sound to a button because I want the sound to load from the outside of the movie. I have a number of sounds loading on level 1 as if there is a constant voice over conversation happening. Each sound replaces with a new sound on level 1 after the previous sound is played. So ideally, I would like to have a button to stop the sound on the level1 timeline. I tried the "stopAllSounds" actionscript which worked, but then when a new conversation was loaded into level1, the sound started playing again. Thanks.

Cota
03-02-2005, 07:22 PM
If you're using the sound object, you just set the volume to 0.

akschinas
03-02-2005, 08:08 PM
But what happens is that once the first sound file reaches its last frame, it loads another sound file in level one. Setting the volume to 0 won't make the timeline stop, the user just won't be able to hear it.

Cota
03-02-2005, 08:15 PM
I'm alittle confused, you want to sound timeline to stop, but you want it load the next sound...? Again, with the sound object you could just tell it to sound.stop. Have you had a look at Kenny Bellew's sound object tutorial:
http://www.kennybellew.com/tutorial/

akschinas
03-02-2005, 09:32 PM
Sorry for confusing you! I have a 2mb wav file of a conversation. I took the wav file into a sound editing software and broke it up into 10 mp3's so that they would stream easier in flash. Then, I loaded each mp3 into its own swf file, and on the last frame of each swf, there is a loadMovieNum action to load the next mp3 and an action to trigger a flashing button on the root timeline. So basically I have 10 swf files loading and unloading on level 1. Now, I would like to be able to stop and start the current running mp3 by having a button target the level 1 timeline to start and stop. I can do that, but the sound keeps playing. I understand about loading mp3's dynamically through the loadSound method, but it doesn't accomplish my goal of calling other swf's to create a continuous conversation. Does this help?

Cota
03-02-2005, 09:42 PM
Now I remember why I hate sounds in flash.....I'm trying to understand why stopAllSounds isnt working for you. Could you post some of the code you're using for this.

akschinas
03-02-2005, 10:06 PM
stopAllSounds DOES work, but the problem is that even though the listener can't hear the audio, the timeline in which the mp3 is on still proceeds to load the next swf when the playhead reaches the last frame and then THAT loaded mp3 plays. The ideal situation would be to stop the playhead on the loaded swf file and ALSO stop the streaming of the mp3.

Here's the code on the first frame of the MC on the root timeline:

loadMovieNum("2230scen_voice.swf", 1)



That swf loads into level1 and plays. When it reaches the last frame on level one, it loads the next movie:

loadMovieNum("2230scen_voice2.swf", 1)



and so on. When we reach the end of the entire conversation after:

loadMovieNum("2230scen_voice10.swf", 1) loads, that triggers a button on the root timeline to flash.


It's all pretty basic timeline control... it's just the streaming part that's got me. The entire conversation lasts about 5 minutes, and if the listener's phone rings, they can't stop it and start it again. They have to reload the entire conversation and start again. There's got to be a way of targeting a streaming mp3 in a swf file... I have faith! Thanks again!

p.s. I would post the file, but I would have to post 20 files with it to get it to work.

akschinas
03-02-2005, 10:09 PM
p.p.s. I just reread my post and wanted to reiterate what I was saying in the first sentence. It's a little confusing:

1. stopAllSounds stops the sound from coming out of the speaker but does not stop the playhead from playing.

2. The playhead still advances to the last frame of the swf file and loads the next swf

3. When that swf is loaded, the sound comes out of the speakers again as if the stopAllSounds command was never initiated.

There, that's better!

thumbslinger
03-04-2005, 03:55 AM
Can you just put an IF Else loop in each swf? If a pause button is clicked, stop all sounds and stop, Else keep on playing? I usually just assign a fake variable a fake value for the Else if that structure works better than a normal IF.

So, if stop all sounds has happened, target the swf on level 1 and stop.

Could also load the clips while a preloader plays and then you have more control over the clips.