PDA

View Full Version : How do I play/stop audio files?


JennySpade
04-06-2003, 08:44 PM
Hi,

In my main scene I have three buttons, each of which reprresents a different song. When the user clicks on "song 1", song one plays. But if you then click on "song 2", song 1 and 2 are playing at the same time. I need to make whatever sound file that's playing stop before the next choice loads.

Oh, and I can't figure out how. That's why i'm here... ;)

cheers,
jen

Billy T
04-06-2003, 10:18 PM
[crosspost]

http://www.actionscript.org/forums/showthread.php3?s=&threadid=25683

JennySpade
04-07-2003, 01:25 AM
... and what, pray, do you think I've been doing for over three hours?

My button (which plays the audio file) is inside a movie clip that resides on the main timeline. I'm assuming that I need to identify the movieclip with the audio file that the button calls from the library? I'm not sure what the problem is. Maybe I'm just overlooking some elementary concept.

While I'm here working at it on my own, if somebody wants to add their two cents that's randy.

thanks for your help.

cheers,
jen

Billy T
04-07-2003, 01:28 AM
Originally posted by JennySpade
... and what, pray, do you think I've been doing for over three hours?


crossposting?

CyanBlue
04-07-2003, 01:37 AM
Oh, don't be so hard on JennySpade...
(JennySpade... Billy T is mad because you crossposted the question... and I normally don't respond to the crossposts either... :mad: )

Just for the record... I have searched the forum with 'play stop sound' and found some relevant threads... Find some more with searching...

The basics of sound object in Flash is pretty much dealt all in this tutorial... Check out Creating a sound player in Flash (http://www.macromedia.com/support/flash/sound/sound_player/) and see if you can pull what you need to do... ;)

Do what you can do and post more detailed question when you have problem... Good luck...

JennySpade
04-07-2003, 05:44 AM
cool, thanks for the link!

for the record... I consider crossposting to be when someone posts the same thread under more than one topic. I did post a related thread on this same board. the only thing is has in common with this thread however, is that it involves audio. pretty broad topic.

billy, were you ever a hall monitor?

;)
cheers,
jenny

CyanBlue
04-07-2003, 05:48 AM
Hall monitor... Um... I thought that is my job here... :D

Did you check out the link??? That page deals many things you should know about the sound object and how to use it... Read it and make it yours... That will make you a happy Flasher... ;)

JennySpade
04-07-2003, 05:55 AM
kewl thank!

Billy T
04-07-2003, 06:48 AM
both of you - pull your socks up and tuck in your shirt.

That better not be chewing gum in your mouth Miss Jenny...

CyanBlue
04-07-2003, 06:59 AM
Watch out for the 'Spade' part... :D

Billy T
04-07-2003, 07:23 AM
yeah I dig...

:rolleyes:

JennySpade
04-07-2003, 07:36 AM
cute.

here's my issue ... want to help?

I have three play buttons. each plays fine when i test the scene. But if one is playing, the others don't work.

i want to click play button 1 to hear song 1, and be able to click button 3 to stop song 1 and play song3... comprende?

cheers,
jen

<< not your average garden hoe >>

CyanBlue
04-07-2003, 07:42 AM
Well... I'll be running away from farafiro... So, I guess Billy T is the one who can help you out...

JennySpade... I think it's best for you to create a sample file and upload it so that others can take a look at it... There is no way we could tell how you are using sound objects right now and how other things are interacting each other...

Well... Good luck to you all... ;)

PS> average garden hoe??? Never heard of that sort of expression... Um... Are you from Idaho or Kansas??? :D

JennySpade
04-07-2003, 05:48 PM
got my files to play... I guess i'm trying to avoid the on/off button thing ... and I'm trying to avoid having two files playing one over the other.

magicwand
04-07-2003, 06:18 PM
how about using function:
stopAllSounds()
???

magicwand
04-07-2003, 07:07 PM
She is from NY also :)
nice to meet you neighbor~!!!

Billy T
04-07-2003, 11:34 PM
yep stopAllSounds() should work (like I said in the other thread)

attaching a new sound to the same sound object should work (like farafiro said in the other thread)

load a new Sound into the same sound object

I suggest you post the code that plays your sounds and then explain just what kind of hoe you are

cheers