Click to See Complete Forum and Search --> : Loading sound into Flash
Eraser Nubbin
12-19-2005, 08:21 PM
Hi guys.
I am trying to build an mildy interactive tutorial for the web in Flash. At this point I have figured out how to get the buttons to jump from label to label and for a sound to play at each label. The problem is that the sounds overlap if you click between sections fast enough. Is there a way to have the soundclip end when you move to a new label?
http://www.hbxcontrols.com/index_tester.htm
Thanks in advance.
Ulysses
12-20-2005, 10:36 AM
Not sure how you've built it, but try ensuring that you stop all sounds, before commencing any new sounds.
Eraser Nubbin
12-20-2005, 02:02 PM
Do you know how I would go about stopping the sounds?
Right now I have just dumped mp3 files onto the timeline... I am guessing it is probably some kind of "unload" action but my Flash coding skills are weak.
reuber1
12-20-2005, 05:49 PM
Ulysses is right, that should work. I forgot what the exact coding is, but just before the new sound loads, you shoud be able to utilize stopallsounds or whatever it is; I'll be damned if I know the code. I don't have access to Flash at the moment.
Craig B
12-20-2005, 06:41 PM
Okay, I haven't doen any flash in quite some time, but this should be a matter of simply setting the "sync" ing correctly. Click your cursor on the sound on the layer and choose the "sync" dropdown in your info box. Start, Stop, Stream and Event. I can't remember which one it is (I think it's stop), but one of thsoe makes sure that your sounds don't double load.
Once again, I'm no flash guru, but from what I remember one of those should work. A flash expert might tell you otherwise.
Eraser Nubbin
12-20-2005, 07:09 PM
I tried the "Stop" option in the sync menu and the sound does not play at all, same with the stream one. It appears that the "Start" one does the same as "Event".
The code that I have on the buttons that navigate from label to label currently looks like this:
on (release) {gotoAndPlay("testStart");
}
From what I can tell the code that I should put on the buttons to make things stop is:
on (release) {
stopAllSounds();
Is it possible for me to put both of these actions on the same button?
Neballer
12-20-2005, 10:21 PM
if you put both of those actions on the same button, I would imagine that they would cancel each other out so that no sounds play.
I would suggest to try this.
Put this code on your main time line.
_root.introSound = new Sound(this);
_root.introSound.attachSound("intro");
"introSound" is the name for my sound variable.
"intro" is the linkage name I've given the sound file in my library.
Now put this on your button
on (release) {
_root.introSound.start(0, 1);
_root.Othersounds1.stop();
_root.Othersounds2.stop();
_root.Othersounds3.stop();
}
So on each button you would have 1 line of code telling it to play the desired sound and 3 lines telling it to stop all the other sounds.
I hope this makes sense
Eraser Nubbin
12-21-2005, 02:16 PM
Thanks Neballer,
The only problem is we expect to have probably close to 100 sounds as the things is going to be a tutorial that gets massive in scale pretty quickly, and I would end up with a lot of code having to cancel out everyother possible sound that could be playing every time that the button got clicked.
reuber1
12-21-2005, 02:24 PM
Couldn't you declare a function on a global level to do that, and call that function whenever you load a new sound? That way you're not replicating code all over the place.
Eraser Nubbin
12-21-2005, 03:05 PM
Uhm.... I don't really know. I truly apologize as I am a complete moron when it comes to Flash. I think I assumed that this would be a nice straight forward voice over thing but I think that I assumed wrong.
reuber1
12-21-2005, 03:17 PM
Congrats on the 1000th! Tell me you got 'yer tacos.
I understand what you're trying to do, I just don't know how to do it off the top of my head. I'm decent with Flash, but when I start getting into code I have to have one of my handy dandy books nearby. I don't right now, but I'll look into it tonight and see what I can find through my actionscript books. I actually did something like this in an old class project, so hopefully I can dig that up (though it was Flash MX).
Eraser Nubbin
12-21-2005, 03:21 PM
Thanks Reuber!
I haven't got the taco yet, was hoping to possibly swap them out for burritos, but I don't want to get too picky.
We learned a lot more Director than Flash in school, which is great is you have a 700mb CD-ROM to work with, not so sweet when you are trying to have the thing load on a plumbers 28k modem.
reuber1
12-22-2005, 11:37 PM
Still looking. All I've found is one giant tutorial in my Beyond the Basics book that has it setup where you have an mp3 audio player and you mess with shared libraries and such.
kerrysmagicshirt
01-12-2006, 06:36 PM
would this have somehting to do with the sync settings?
Eraser Nubbin
01-12-2006, 06:53 PM
Kerry- Thats what it would seem... I tried different combinations, the ones that were supposed to work gave me the result of no sound whatsoever, I must have something awry in my file somewhere.
Yet to figure out what yet.
reuber1
01-12-2006, 07:35 PM
I've tried to find something, I've had way too much sh!t to do lately. That one tutorial in my book sounds WAY too complicated for something like this. I know I did something like this for a project in school, I'll have to dig up one of my old backup disks and see if I still have it.
jlknauff
01-13-2006, 02:01 PM
post your .fla
Eraser Nubbin
01-16-2006, 03:04 PM
I removed the sound from the thing for now... got enough other areas to work on. Will post the flash up as soon as I have to address the sound.
Thanks guys.