Groups | Blog | Home
all groups > flash (macromedia) > july 2003 >

flash (macromedia) : Playing sound, stopping all other sound?



Tanya
7/22/2003 11:23:01 PM
Hi!

I'm just learning actionscripting, and I'm a little confused about sound
interactivity.

I have some buttons with sounds that I've scripted for each button. (not
within the button, but with actionscripting attached to the button's
instance). What I need to do is stop any other currently playing sound in
the movie when the user clicks this button to hear that particular mp3 file.

Here's the script I think should work, but the sound doesn't play: (in the
sound's linkage, I've chosen "export to actionscript" and "export in first
frame")

on (release) {
stopAllSounds();
}
on (release) {
mySound.attachSound("BD-rave");
}
on (release) {
mySound.start();
}

Can anyone tell me why this doesn't work? It seems simple enough?

Thanks!
Tanya



Jim G
7/23/2003 7:02:57 AM
Don't you have to create the sound object first?

Jim

[quoted text, click to view]

Peter Lee
7/24/2003 10:59:06 AM
It seems to me that it should work. Maybe you can try to put all the
actions under one on(release) instead of having 3

Peter

--
Peter Lee

Novel Games - Free Game Downloads and Free Flash Games
Visit us at: http://www.novelgames.com



[quoted text, click to view]
AddThis Social Bookmark Button